Hi People =D , i'm new to C++ and i need help ..
i'm trying to finish my assignment but i don't know how to finish it -P
I need to make a project that do these .
-It asks the user to guess your favorite number.
-If the user guesses the right number, it tells them they got it right.
-The program doesn't have to do anything if the user guesses wrong.
int main()
{
// Variables:
int secretNumber = 7;
int userguess;
// instructions:
cout << "Hello can you guess Shawn's favorite number?" << endl;
// recieve input from user:
cin >> userguess;
// now here is where you need to check the conditions
// you want to decide what ur program will answer
// Checking condition:
if (userguess == secretNumber) // did user guess correct?
{
cout << "That is amazingly correct!"<<endl;
}
// or did he guess wrong?
else
cout << "not true!"; // from your description of the task this is not needed.
return 0;
}