update
This commit is contained in:
BIN
DEV/DEV1.1/TP_Boucles/exe
Executable file
BIN
DEV/DEV1.1/TP_Boucles/exe
Executable file
Binary file not shown.
18
DEV/DEV1.1/TP_Boucles/q1 (dowhile).c~
Normal file
18
DEV/DEV1.1/TP_Boucles/q1 (dowhile).c~
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int reel1;
|
||||
int reel2;
|
||||
|
||||
printf("Saisissez un premier réel : ");
|
||||
scanf("%d", &reel1);
|
||||
printf("Saisissez un second réel : ");
|
||||
scanf("%d", &reel2);
|
||||
|
||||
while (reel1<=reel2){
|
||||
printf("%d\n", reel1);
|
||||
reel1 += 1;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
DEV/DEV1.1/TP_Boucles/q1.c
Normal file
18
DEV/DEV1.1/TP_Boucles/q1.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int reel1;
|
||||
int reel2;
|
||||
|
||||
printf("Saisissez un premier réel : ");
|
||||
scanf("%d", &reel1);
|
||||
printf("Saisissez un second réel : ");
|
||||
scanf("%d", &reel2);
|
||||
|
||||
while (reel1<=reel2){
|
||||
printf("%d\n", reel1);
|
||||
reel1 += 1;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
0
DEV/DEV1.1/TP_Boucles/q1.c~
Normal file
0
DEV/DEV1.1/TP_Boucles/q1.c~
Normal file
18
DEV/DEV1.1/TP_Boucles/q1_dowhile.c
Normal file
18
DEV/DEV1.1/TP_Boucles/q1_dowhile.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int reel1;
|
||||
int reel2;
|
||||
|
||||
printf("Saisissez un premier réel : ");
|
||||
scanf("%d", &reel1);
|
||||
printf("Saisissez un second réel : ");
|
||||
scanf("%d", &reel2);
|
||||
|
||||
do {
|
||||
printf("%d\n", reel1);
|
||||
reel1 += 1;
|
||||
} while (reel1<=reel2);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
17
DEV/DEV1.1/TP_Boucles/q1_for.c
Normal file
17
DEV/DEV1.1/TP_Boucles/q1_for.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int reel1;
|
||||
int reel2;
|
||||
|
||||
printf("Saisissez un premier réel : ");
|
||||
scanf("%d", &reel1);
|
||||
printf("Saisissez un second réel : ");
|
||||
scanf("%d", &reel2);
|
||||
|
||||
for (;reel1<=reel2;reel1+=1){
|
||||
printf("%d\n", reel1);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
DEV/DEV1.1/TP_Boucles/q1_for.c~
Normal file
18
DEV/DEV1.1/TP_Boucles/q1_for.c~
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int reel1;
|
||||
int reel2;
|
||||
|
||||
printf("Saisissez un premier réel : ");
|
||||
scanf("%d", &reel1);
|
||||
printf("Saisissez un second réel : ");
|
||||
scanf("%d", &reel2);
|
||||
|
||||
for (;reel1<=reel2;reel1+=1){
|
||||
printf("%d\n", reel1);
|
||||
reel1 += 1;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
13
DEV/DEV1.1/TP_Boucles/q2.c
Normal file
13
DEV/DEV1.1/TP_Boucles/q2.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
double noteBac;
|
||||
do {
|
||||
printf("Saisissez une note de bac comprise entre 0 et 10 : ");
|
||||
scanf("%d", ¬eBac);
|
||||
printf("Vous avez saisis : ");
|
||||
printf("%d\n",noteBac);
|
||||
} while(noteBac>=10);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
13
DEV/DEV1.1/TP_Boucles/q2.c~
Normal file
13
DEV/DEV1.1/TP_Boucles/q2.c~
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
double noteBac;
|
||||
do {
|
||||
printf("Saisissez une note de bac comprise entre 0 et 10 : ");
|
||||
scanf("%d", noteBac);
|
||||
printf("Vous avez saisis : ");
|
||||
printf("%d\n",noteBac);
|
||||
} while(noteBac>=10);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
17
DEV/DEV1.1/TP_Boucles/q3.c
Normal file
17
DEV/DEV1.1/TP_Boucles/q3.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int table;
|
||||
int i;
|
||||
printf("Saisissez un chiffre : ");
|
||||
scanf("%d", &table);
|
||||
for (i=0;i<=10;i+=1){
|
||||
printf("%d",i);
|
||||
printf(" x ");
|
||||
printf("%d",table);
|
||||
printf(" = ");
|
||||
printf("%d\n",i*table);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
0
DEV/DEV1.1/TP_Boucles/q3.c~
Normal file
0
DEV/DEV1.1/TP_Boucles/q3.c~
Normal file
24
DEV/DEV1.1/TP_Boucles/q4.c
Normal file
24
DEV/DEV1.1/TP_Boucles/q4.c
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int numerateur;
|
||||
int denominateur;
|
||||
int quotient=0;
|
||||
printf("Saisissez un entier : ");
|
||||
scanf("%d", &numerateur);
|
||||
printf("Saisissez un entier strictement positif : ");
|
||||
scanf("%d", &denominateur);
|
||||
while(numerateur>=denominateur){
|
||||
numerateur -= denominateur;
|
||||
quotient += 1;
|
||||
}
|
||||
printf("%d", quotient*denominateur+numerateur);
|
||||
printf(" = ");
|
||||
printf("%d", quotient);
|
||||
printf(" x ");
|
||||
printf("%d", denominateur);
|
||||
printf(" + ");
|
||||
printf("%d", numerateur);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
0
DEV/DEV1.1/TP_Boucles/q4.c~
Normal file
0
DEV/DEV1.1/TP_Boucles/q4.c~
Normal file
Reference in New Issue
Block a user