Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Game()
- {
- srand ( time (NULL) );
- Random_Number();
- cout<<" <-W-E-L-C-O-M-E->"<<endl<<endl;
- cout<<" >-E-N-J-O-Y-<"<<endl<<endl;
- for( e = 0; e <= 2; e++ )
- {
- cout<<"Guess a Number from 1-10: ";
- cin>> num;
- if (num != given)
- {
- cout<<"Wrong Number, Guess Again\n";
- cout<<"Attempt Left "<<3-e<<endl;
- if ( num > given )
- cout<<"The Number is Greater than "<<num<<endl;
- else if ( num < given )
- cout<<"The Number is Less than "<<num<<endl;
- }
- else
- {
- cout<<"Correct, You Won!\n";
- cout<<"Thank You For Playing\n";
- break;
- }
- }
- cout<<"The Correct Number is "<<given<<endl;
- }
Add Comment
Please, Sign In to add comment