This C++ program is not compiling. What do you think is the error with the program?
#include<iostream>
using namespace std;
int main()
{
int arr[10];
arr={1,2,3,4,5,6,7,8};
cout<<"arr[0]="<<arr[0];
return 0;
}
Is the error due to
Download the Simplif ied C++ by Hegdeapps now
#include<iostream>
using namespace std;
int main()
{
int arr[10];
arr={1,2,3,4,5,6,7,8};
cout<<"arr[0]="<<arr[0];
return 0;
}
Is the error due to
- Not using printf
- Initialising the array with only 8 elements instead of 10
- Initialising array in the next statement instead of in definition.
- None of the above
Download the Simplif ied C++ by Hegdeapps now
By the way the correct answer is (3)
Comments
Post a Comment