int main()
{
int number=rand()%1 00; // rand undecl/?
int
guess=-1;
int trycount=0;
while(guess!=nu mber && trycount<8)
{
{cout<<"Please enter a guess: "; // cout undecl/?
cin>>guess; // cin undecl/?
if(guess<number )
cout<<"Too low"<<endl; //endl undecl/?
if(guess>number )
cout<<"Too high"<<endl;
trycount++;
}
if(guess==numbe r)
{
cout<<"You guessed the"
"number";
}
else
{
cout<<"Sorry, the number was:"
<<number;
}
return 0;
} // expected `}' at end input/?
here is what the compiler is saying is wrong.the // is just
comments from the compiler... trying to get the basics and get to recognize them quickly...thank s for the help..
{
int number=rand()%1 00; // rand undecl/?
int
guess=-1;
int trycount=0;
while(guess!=nu mber && trycount<8)
{
{cout<<"Please enter a guess: "; // cout undecl/?
cin>>guess; // cin undecl/?
if(guess<number )
cout<<"Too low"<<endl; //endl undecl/?
if(guess>number )
cout<<"Too high"<<endl;
trycount++;
}
if(guess==numbe r)
{
cout<<"You guessed the"
"number";
}
else
{
cout<<"Sorry, the number was:"
<<number;
}
return 0;
} // expected `}' at end input/?
here is what the compiler is saying is wrong.the // is just
comments from the compiler... trying to get the basics and get to recognize them quickly...thank s for the help..
Comment