What will the output of the below code?
#include <iostream>
using namespace std;
int main()
{
int arr[2] = { 1, 2 };
cout << arr[0] << ", " << arr[1] << endl;
return 0;
}
public class Main {
public static void main(String[] args) {
int[] arr = {1, 2};
System.out.println(arr[0] + ", " + arr[1]);
}
}
1, 2
Syntax error
Run time error
None
This question is part of this quiz :
Top MCQs on Array Data Structure with Answers