Untitled


SUBMITTED BY: Guest

DATE: May 21, 2013, 9:01 p.m.

FORMAT: Text only

SIZE: 737 Bytes

HITS: 978

  1. #include "stdafx.h"
  2. #include <iostream>
  3. #include <ctime>
  4. using namespace std;
  5. int main()
  6. {
  7. int count= 0;
  8. int answer;
  9. int guess;
  10. srand(time(0));
  11. guess = rand() %101;
  12. do{
  13. cout << "Enter a number between 1 and 10";
  14. cin>> answer;
  15. }
  16. while (answer > guess);
  17. {
  18. cout <<"Your guess is too high" << endl;
  19. } else if (answer < guess); error here Intellisense: expected a statement
  20. {
  21. cout << "Your guess is too low" << endl;
  22. } else if{count++);error here Intellisense: expected a statement
  23. }while (answer!=guess);
  24. if (answer == guess)
  25. cout <<"You guessed it" <<endl;
  26. system("pause");
  27. return 0;