CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following ANSI C program:

#include<stdio.h>
int main( )
{
int arr [4] [5] ;
int i, j;
for (i = 0; i < 4; i++)
{
for (j = 0; j<5; j++)
{
arr [i] [j] = 10 * i + j;
}
}
printf("%d", *(arr[i] + 9));
return 0;
}

What is the output of the above program?

A
30
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
20
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
24
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
D
14
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is C 24
int a[4] [5]
[*(a + 1) + 9]
It means skip one row and then skip 9 elements.
So, the resultant value is 24.

flag
Suggest Corrections
thumbs-up
0
similar_icon
Similar questions
View More
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Quantum Numbers
CHEMISTRY
Watch in App
Join BYJU'S Learning Program
CrossIcon