What will be the output of the below code? #include <iostream> using namespace…
2025
What will be the output of the below code?
#include <iostream>
using namespace std;
int main()
{
int arr[2] = {1, 2};
cout << 0[arr] << ", " << 1[arr] << endl;
return 0;
}Answer: A. 1, 2
- A.
1, 2
- B.
Syntax error
- C.
Run time error
- D.
None of these
Attempted by 192 students.
Show answer & explanation
Correct answer: A
Loading lesson…