Rabu, 06 April 2016

contoh perulangan for

#include <iostream>
#include <conio.h>
//perulanan for
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
int main(int argc, char** argv) {
    int i,j;
    for (i=1;i<=5;i++)
    { cout<<i<<endl;
    for (j=1;j<=3;j++)
    cout<<"  "<<j;
    cout<<endl;
    }
    return 0;
}

Tidak ada komentar:

Posting Komentar