DEV/DEV1.1/TP05:Boucles/Boucles:suite/table.c

28 lines
476 B
C
Raw Permalink Normal View History

2022-10-04 17:58:52 +02:00
#include <stdio.h>
#include <stdlib.h>
int main() {
int n;
int i=0;
int j;
printf("Veuillez saisir la taille de la table: ");
scanf("%d",&n);
const int taille=n;
printf(" X |");
while(i<=taille){
printf("%4d",i);
i++;
} printf("\n");
i=0;
while (i<=taille+1){
i++;
printf("----");
} printf("\n");
for (i=0;i<=taille;i++){
printf("%3d |",i);
for (j=0;j<=taille;j++){
printf("%4d",i*j);
} printf("\n");
}
return 0;
}