Advertisement
Guest User

abc123

a guest
Apr 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int guess;
  10. int number;
  11.  
  12. number = rand() % 1000 + 1;
  13.  
  14. while ( <=8)
  15.  
  16. cout << "Guess a number: ";
  17. cin >> guess;
  18.  
  19. if (guess > number)
  20. {
  21. cout << "Your Guess is too high!" << endl;
  22. }
  23.  
  24. else if (guess < number)
  25. {
  26. cout << "Your Guess is too low!" << endl;
  27. }
  28.  
  29. else
  30. cout << "You Are Right!" << endl;
  31.  
  32.  
  33. system("PAUSE");
  34.  
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement