alrite i just started learning c 3 days ago and i decided to c what i cud put together with the knowledge ive gained so far. so i decided to make a game, nothing complex by any means, but its a guessing game, i didnt come up with the idea, i just wanted to c if i cud figure out how to do it. so i entered in a code fixed all the errors i could. got all the errors fixed except for the last 1, which i cannot seem to find the problem?
here is the code
#include<iostream>
#include<ctime>
using namespace std;
int main (void);
{
int iUser;
int iGuess = 0;
int iGuesses = 0;
int iNumber = 0;
srand(static_cast<unsigned int>(time(0) ) );
iNumber = rand()00 1;
cout << "Enter your name: " << endl;
cin >> iUser
cout << iUser << " Enter a number 1-1000" << endl << endl;
cin >> iGuess
if
{
(iGuess > || < iNumber)
cout << "You got it!!!"
iGuesses ;
cout << "The number is: " << iNumber
<< endl;
cout << "You took " << iGuesses
<< endl;
}
if
{
(iGuess > iNumber)
cout << "Too high!!!" << endl;
cin >> iGuess
}
if
{
(iGuess < iNumber)
cout << "Too low!!!" << endl;
cin >> iGuess
}
system("PAUSE")
return 0;
}
the error is on line six with the opening curly bracket.
it says "line 6 - expected unqualified-id before '{' token",
and "line 6 - expected ',' or ';' before '{' token"
idk if this is just a stupid mistake and im just missing something but ive been over it 100 times and cant seem to find a problem with that bracket?
so yea any help would be greatly appreciated
thnx
Tags: