Ajout des fichiers des séances précédentes
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
int main(void) {
|
|
||||||
int n;
|
|
||||||
double x;
|
|
||||||
printf("entrez un nombre : ");
|
|
||||||
n = scanf("%lf", &x);
|
|
||||||
printf("%f\n", x);
|
|
||||||
return EXIT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
@@ -1 +0,0 @@
|
|||||||
jabbar@salle224-01.6268:1757929846
|
|
@@ -6,7 +6,7 @@ int main(void) {
|
|||||||
double x;
|
double x;
|
||||||
printf("entrez un nombre : ");
|
printf("entrez un nombre : ");
|
||||||
n = scanf("%lf", &x);
|
n = scanf("%lf", &x);
|
||||||
printf("%f\n", x,x,x,x,x,x);
|
printf("%f\n", x);
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
25
DEV1.1/TP06/Exo1.c
Normal file
25
DEV1.1/TP06/Exo1.c
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int x=3;
|
||||||
|
|
||||||
|
if (x=2) {
|
||||||
|
printf("x vaut 2\n");
|
||||||
|
} else {
|
||||||
|
printf("x est different de 2\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d\n", x);
|
||||||
|
|
||||||
|
if (x=0) {
|
||||||
|
printf("x vaut 0\n");
|
||||||
|
} else {
|
||||||
|
printf("x est different de 0\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("%d\n", x);
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
14
DEV1.1/TP06/Exo2.c
Normal file
14
DEV1.1/TP06/Exo2.c
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int x;
|
||||||
|
printf("entrez un nombre entier");
|
||||||
|
x = scanf("%d",&x);
|
||||||
|
|
||||||
|
if (x>0) {
|
||||||
|
printf("%d\n", x*3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
0
DEV1.1/TP06/réponses.txt
Normal file
0
DEV1.1/TP06/réponses.txt
Normal file
Reference in New Issue
Block a user