DEV/BUT1/DEV1.1/Boucles/s#U00e9quencefor.c

29 lines
487 B
C
Raw Normal View History

2024-02-01 13:55:03 +01:00
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
int nombre1 = 0;
int nombre2 = 0;
printf("Saisissez un nombre entier :\n");
scanf("%d", &nombre1);
printf("Saisissez le second nombre :\n");
scanf(" %d", &nombre2);
if (nombre1 > nombre2)
{
printf("Erreur : le premier nombre est supérieur au second. \n");
}
else
{
for (int i = nombre1; i < nombre2; i++)
{
printf("%d\n", i);
}
}
}