Create Pola1.c

master
MD15 2020-04-10 12:39:17 +07:00 committed by GitHub
parent b99b3a7b9a
commit 7dee635614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 0 deletions

19
06. Perulangan/Pola1.c Normal file
View File

@ -0,0 +1,19 @@
#include <stdio.h>
int main () {
int i,j;
int n,k;
scanf("%d %d",&n,&k);
for(i=1;i<=n;i++) {
if (i>1) {
printf(" ");
}
if (i % k == 0) {
printf("*");
}
else {
printf("%d", i);
}
}
printf("\n");
}