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

What does the following program segment print?
main 0
{
int i
int iarray [4] ={1, 2, 3, 4}
# define Size (size of (iarray)/size of (int))
for (i=0; i< size;++i)
iarry [i] +=2;
printf ("value is % d/n", iarry
[3];
}

A
3
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
6
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Compilation error because of # define with in main module
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
None of the above
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B 6

The following program segment print:-

main 0
{
int i
int iarray [4] ={1, 2, 3, 4}
# define Size (size of (iarray)/size of (int))
for (i=0; i< size;++i)
iarry [i] +=2;
printf ("value is % d/n", iarry
[3];
}

Output:-

4 + 2=6.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Permutations
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon