9/20 이중 반복문,구구단 만들기
C
#include <stdio.h>
int main() {
int i,j,k;
// for(i=1;i<=9;i++){
// printf("2 x %d = %d\n", i, i*2);
// }
// for(i=2;i<10;i++){
// for(j=1;j<10;j++){
// printf("%d x %d = %d\n",i,j,i*j);
// }
// printf("\n");
// }
for(i=1;i<=5;i++){
for(k=i;k<5;k++){
printf(" ");
}
for(j=1;j<=i;j++){
printf("*");
}
printf("\n");
}
}
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.