Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guess game #25

Open
vikasjaiswar opened this issue Oct 18, 2020 · 1 comment
Open

guess game #25

vikasjaiswar opened this issue Oct 18, 2020 · 1 comment

Comments

@vikasjaiswar
Copy link
Contributor

#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int main(){
int number, guess ,ngueses=1;
srand(time(0));
number=rand()%100 + 1;
printf("the number is %\n", number);

do{
printf("guess the number between 1 t 100\n");
scanf("%d",&guess);
if(guess<numer){
printf("lower number please\n")
}
else if(guess>numer)
printf("higher number please\n")
}
else{
printf("you guesse it in %d attempts\n", nguesses);
}
nguesses++;
}while(guess!=number);
return0;
}

@vikasjaiswar
Copy link
Contributor Author

#include<stdio.h>
#include<stdlib.h>
#include<time.h>

int main(){
int number, guess ,ngueses=1;
srand(time(0));
number=rand()%100 + 1;
printf("the number is %\n", number);

do{
printf("guess the number between 1 t 100\n");
scanf("%d",&guess);
if(guess<numer){
printf("lower number please\n")
}
else if(guess>numer)
printf("higher number please\n")
}
else{
printf("you guesse it in %d attempts\n", nguesses);
}
nguesses++;
}while(guess!=number);
return0;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant