DEV/DEV1.1/TP05:Boucles/sequence.c

20 lines
266 B
C
Raw Normal View History

2022-10-04 17:58:52 +02:00
#include <stdio.h>
int main() {
int n;
int m;
int i;
printf("Veuillez saisir 2 entiers separer d'un espace.\n");
scanf("%d",&n);
scanf(" %d",&m);
if (n>m){
for (i=m;i<=n;i++){
printf("%d\n",i);
}
} else{
for (i=n;i<=m;i++){
printf("%d\n",i);
}
}
return 0;
}