I did fine on this in C, not sure what I'm doing wrong here. Probably something silly on my end. I'm receiving odd numbers in my program below. I have included the output below the program. Any assistance would be quite appreciated. Thanks!
#include <iostream>
int main()
{
using namespace std;
int exercise[5], i;
cin >> exercise[0];
for (i = 0; i < 5; i++)
{
cout << exercise[i] << endl;
}
return 0;
}
------------------------------------
I enter the numbers 1, 2, 3, 4, and 5 in the beginning. I am expecting the Output to be:
1 2 3 4 5
1
2
3
4
5
Press any key to continue...
but instead, the output is:
1 2 3 4 5
1
4313739
4313508
4313739
4268019
Press any key to continue . . .