DEV/BUT1/DEV1.1/revision/cercle.c

23 lines
416 B
C
Raw Normal View History

2024-02-01 13:55:03 +01:00
#include <stdlib.h>
#include <stdio.h>
int main() {
int rayon;
int i, j;
printf("Rayon ? ");
scanf("%d", &rayon);
for (i = -rayon; i <= rayon; i++) {
for (j = -rayon; j <= rayon; j++) {
if (i * i + j * j <= rayon * rayon) {
printf("* ");
} else {
printf(" ");
}
}
printf("\n");
}
return 0;
}