35 lines
471 B
C
35 lines
471 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int main(void) {
|
||
|
|
||
|
int i;
|
||
|
int chiffre = 0;
|
||
|
srand(time(NULL));
|
||
|
int var = rand()%100+1 ;
|
||
|
for(i= 0; i < 5; i++){
|
||
|
printf("rentrez un entier :");
|
||
|
scanf("%d", &chiffre);
|
||
|
if (chiffre == var) {
|
||
|
printf("c'est le bon chiffre Bravo !\n");
|
||
|
return EXIT_SUCCESS; }
|
||
|
if (chiffre > var) {
|
||
|
printf("-\n");
|
||
|
}else{
|
||
|
if (chiffre < var ) {
|
||
|
printf("+\n");}
|
||
|
}
|
||
|
}
|
||
|
printf("Le chiffre était : %d\n",var);
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|