May 2021 2 74 Report
C++ Undeclared Identifier?

When I complie it says, "error C2065: 'Favorite_Number1' : undeclared identifier" what can i do to fix this?

//Favorite_Number

//Include the iostream library

#include <iostream>

//Use the standard namespace

using namespace std;

void main ( )

{

// Give instructions

cout << "Can you guess my favorite number?" << endl;

cin >> Favorite_Number1;

if (Favorite_Number1 == 6)

{

// Print text

cout << "Yay That's Correct!" << endl;

}

system ("PAUSE");

}


Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments




Helpful Social

Copyright © 2024 Q2A.MX - All rights reserved.