Question 5
What is the output of the following code:
#include <bits/stdc++.h>
using namespace std;
int main() {
int arr[5] = {1, 2, 3};
//Printing the value
cout<< arr[4]<<endl;
return 0;
}
Question 6
Which of the following statements correctly declares a two-dimensional integer array in C/C++?
Question 7
In an array int arr[3]={1,2,3}, what will happen if we try to access arr[4] in C/C++?
Question 8
What is the output of the following program?
#include <iostream>
using namespace std;
int main()
{
int arr[5] = { 2, 6, 8, 13, 19 };
// Modifing the data
for (int i = 0; i < 5; i += 2)
arr[i]++;
for (int i = 0; i < 5; i++)
cout << arr[i] << endl;
return 0;
}
There are 30 questions to complete.