DEV/DEV1.1/TP05/grandetable.c

27 lines
400 B
C
Raw Normal View History

2022-10-04 17:30:38 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void){
int x = 0;
int i;
int j;
printf("Rentrer un entier: ");
scanf("%d",&x);
printf("X |");
for (i=0;i<x+1;i++){
printf("%5d",i);
}
printf("\n");
for (i=0;i<x;i++){
printf("------");
}
printf("\n");
for(i=0;i<x+1;i++) {
printf("%5d |",i);
for(j=0;j<x+1;j++) {
printf("%5d",i*j);
}
printf("\n");
}
return EXIT_SUCCESS;
}