I need some assistance in figuring out why I am receiving error code
I need some assistance in figuring out why I am receiving error code C2065 in the below code:// Week 3
Assignment-1
// Description: Compile time errors with loops and branching
//———————————-
//**begin #include files************
#include // provides access to cin and cout
#include // to allow seeding the random number generator using time
//–end of #include files———–
//———————————-
using namespace std;
//———————————-
//**begin global constants**********
const int arraySize = 5;
//–end of global constants———
//———————————-
//**begin main program**************
int main()
{
// seed random number generator
srand(time(NULL));
// create a flag to end the while loop
bool endLoop = false;
// create an int array
int array[arraySize];
// initialize the int array
for (int i = 0; i {
array[i] = (rand() % 50) + 50;
}
int number;
int mysteryNum;
int arrayNum;
while (!endLoop)
{
mysteryNum = rand() % 40;
arrayNum = array[rand() % arraySize];
cout cin >> number;
if (mysteryNum == arrayNum – number)
{
cout }
else
{
cout endLoop = true;
}
}
cin.get();
// Wait for user input to close program when debugging.
cin.get();
return 0;
}
//–end of main program————-
//———————————-
VS 2015 is telling me ‘i’: undeclared identifier at array[i] = (rand() % 50) + 50; line of code. Any help will be greatly appreciated