- 5

What is the output of given C++ code? Int n[4] {22,14} ; cout<<n[3];

C++

31st Jul 2021, 12:58 PM
kamoyak
kamoyak - avatar
3 RĂ©ponses
+ 1
kamoyak Output will be 0 because the size of array is 4 so array will store 22, 14, 0, 0 int a[4] = {22, 14}; cout << a[2]; //0
31st Jul 2021, 1:03 PM
AÍąJ
AÍąJ - avatar
+ 3
Okay. Thanks alot 😊😊
31st Jul 2021, 1:05 PM
kamoyak
kamoyak - avatar
+ 1
n[0]=22 n[1]=14 n[2]=0 n[3]=0
31st Jul 2021, 1:52 PM
Abhishek Kumar
Abhishek Kumar - avatar