exo tp6
This commit is contained in:
@@ -15,4 +15,4 @@ int main(void){
|
|||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
25
DEV1.1/TP06/exo3.c
Normal file
25
DEV1.1/TP06/exo3.c
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
int r1;
|
||||||
|
int r2;
|
||||||
|
int err1;
|
||||||
|
int err2;
|
||||||
|
|
||||||
|
printf("Saisir le premier réel :\n");
|
||||||
|
err1 = scanf("%d",&r1);
|
||||||
|
|
||||||
|
printf("Saisir le second réel :\n");
|
||||||
|
err2 = scanf("%d",&r2);
|
||||||
|
|
||||||
|
if ((r1 > -1 && r2 > -1) || (r1 <0 && r2 <0)){
|
||||||
|
|
||||||
|
/* si (R1>-1) ET (R2>-1) est vrai alors + sinon - OU (R1<0) et (R2<0) est vrai alors + sinon -.Si aucune des deux conditions est vrai alors ca renvoie */
|
||||||
|
|
||||||
|
printf("le signe du produit est +\n");
|
||||||
|
} else {
|
||||||
|
printf("le signe du produit est -\n");
|
||||||
|
}
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
0
DEV1.1/TP06/exo4.c
Normal file
0
DEV1.1/TP06/exo4.c
Normal file
Reference in New Issue
Block a user