Guest User

Untitled

a guest
Jun 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. void Game()
  2. {
  3. srand ( time (NULL) );
  4. Random_Number();
  5.  
  6. cout<<" <-W-E-L-C-O-M-E->"<<endl<<endl;
  7. cout<<" >-E-N-J-O-Y-<"<<endl<<endl;
  8.  
  9. for( e = 0; e <= 2; e++ )
  10. {
  11. cout<<"Guess a Number from 1-10: ";
  12. cin>> num;
  13.  
  14. if (num != given)
  15. {
  16. cout<<"Wrong Number, Guess Again\n";
  17. cout<<"Attempt Left "<<3-e<<endl;
  18.  
  19. if ( num > given )
  20. cout<<"The Number is Greater than "<<num<<endl;
  21. else if ( num < given )
  22. cout<<"The Number is Less than "<<num<<endl;
  23. }
  24. else
  25. {
  26. cout<<"Correct, You Won!\n";
  27. cout<<"Thank You For Playing\n";
  28. break;
  29. }
  30. }
  31.  
  32. cout<<"The Correct Number is "<<given<<endl;
  33.  
  34. }
Add Comment
Please, Sign In to add comment