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

20 lines
266 B
C
Raw Permalink Normal View History

2022-09-28 16:42:11 +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;
}