DEV/DEV1.1/TP03/sequence.c

45 lines
504 B
C
Raw Normal View History

2022-09-27 16:14:04 +02:00
#include <stdio.h>
#include <stdlib.h>
int main(void){
int y=0;
int x=0;
printf("saisir deux entier: ");
scanf("%d %d",&x,&y);
/*
if ((x>y)==1) {
while (y!=x) {
y++;
printf("%d \n",y);
}
}
else {
while (y!=x) {
x++;
printf("%d \n",x);
}
}
*/
/*
if ((x>y)==1) {
do {
y++;
printf("%d \n",y);
} while (y!=x-2);
}
else {
do {
x++;
printf("%d \n",x);
} while (y!=x-1);
}
*/
int i;
for(i=x+1;i<y;i++){
printf("%d \n",i);
}
return EXIT_SUCCESS;
}