Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- int counter
- {
- int num , guess;
- counter = 0;
- srand(time(0));
- num = rand() % 200 + 1;
- printf ( "Guessing game, guess the number between 1 and 200" );
- do {
- scanf ( "%d" , &guess);
- if ( guess > num ){
- printf ( "Too high" );
- }
- if ( guess < num ){
- printf ( "Too low" );
- }
- if ( guess == num ){
- counter++;
- printf ( "Your guess is correct!, it took you %d tries" , counter );
- }
- }while (guess != num);
- return 0;
- }
Add Comment
Please, Sign In to add comment