DEV/BUT1/DEV1.1/Boucles/tables.c
2024-02-01 13:55:03 +01:00

25 lines
609 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int table;
printf("Choisissez la table de multiplication que vous voulez afficher :\n");
printf("Ou saisissez -1 pour stopper le programme : ");
scanf("%d", &table);
while (table != -1)
{
int i;
for (i = 0; i <= 10; i += 1)
{
printf("%d", i);
printf(" x ");
printf("%d", table);
printf(" = ");
printf("%d\n", i * table);
}
printf("Table à afficher (-1 = stop) : ");
scanf("%d", &table);
}
return EXIT_SUCCESS;
}