DEV_BUT1/DEV1.1/TP05/table.c

30 lines
468 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void){
int x=0;
int b=0;
int cons=10;
int i;
int acc = 0;
printf (" X | ");
for(i=0; i <=cons; i = i+1){
printf("%4d", i);
}
printf("\n");
printf("----+");
for(i = 0; i <=cons; i = i+1){
printf("----");
}
printf("-");
printf("\n");
for(x = 0; x <=cons; x = x+1){
printf("%4d", x);
printf("|");
for(b = 0; b<=cons; b = b+1){
printf("%4d", x*b);
}
printf("\n");
}
return EXIT_SUCCESS;
}