0
Give reason for output 3.
#include <iostream> using namespace std; int main() { int arr[2][3]={{3,5,1},{2,9,4}}; int brr[2][3]={{2,5,8},{9,2,6}}; for(int i=0;i<2;i++){ for(int j=0;j<3;j++){ brr[i][j]+=arr[i][j]; } } cout<<brr[1][3]; return 0; }
2 Réponses
+ 1
It was asked in a challenge in this app and the output is actually 3.
As I copied the code and had run this one
0
in the statement " cout<<brr[1][3];"
index is out of boundary. maybe you want to output brr[1][2] which is 10.