#include<stdio.h>
#include<conio.h>
main(){
int baris,angka=1;
printf("Masukkan banyak baris : ");scanf("%i",&baris);
printf("\n");
for(int y=1; y<=baris; y++){
for(int x=1; x<=y; x++){
printf("%d\t ",angka);
angka = angka + 1;
}
printf("\n");
}
getch();
}
#include<conio.h>
main(){
int baris,angka=1;
printf("Masukkan banyak baris : ");scanf("%i",&baris);
printf("\n");
for(int y=1; y<=baris; y++){
for(int x=1; x<=y; x++){
printf("%d\t ",angka);
angka = angka + 1;
}
printf("\n");
}
getch();
}
No comments