Minggu, 23 September 2012

Contoh Program C++ Perulangan For

#include<stdio.h>
#include<conio.h>

int main()
{int n,a,b;

printf("Input Angka : ");

scanf("%d",&n);
for(a=1;a<=n;a++){
for(b=1;b<=a;b++){

if(a==b)

printf("%3i",b);
else

printf("");}
}
getch();}

Tidak ada komentar:

Posting Komentar