#include<stdio.h>
#include<stdlib.h>
int main()
{
int number, guess;
printf("Enter your guess!\n");
scanf("%d",&guess);
number=rand()%1000;
while(guess!=-1)
{
while(guess!=number)
{
if(guess>number){
printf("Too high! try again!\n");
}
else{
printf("Too low.try again!\n");
}
printf("Enter your guess!\n");
scanf("%d",&guess);
}
printf("Excellent! You guessed the number\nWould you like to play again?if you want press-2\n if you don't want to play press -1\n");
scanf("%d",&guess);
if(guess==-2){
number=rand()%1000;
printf("Enter your guess!\n");
scanf("%d",&guess);
}
}
printf("Thank you!");
return 0;
}
ferid mövsümov
faridmovsumov@gmail.com