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

What is printed by the following C program?
int f(int x, int*py, int ** ppz)
{ int y, z;
**ppz + = 1; z = **ppz;
*py + = 2; y = *py;
x+ =3;
return x+ y + z;
}
void main( )
{ int c, *b, **a;
c = 4; b = &c; a = &b;
print ("%d", f(c, b, a));
}

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

The correct option is D 19
f(c, b, a) is called by the main( ) function the graphical execution of the program is given below.

x + y + z = 7 + 7 +5 = 19
int y, z;
**ppz = ** ppz +1;
z = **ppz = 5;
*py = *py +2;
y = * py = 7
x = 4+3 = 7
return x + y + z = 19

flag
Suggest Corrections
thumbs-up
4
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Levels of Management
BUSINESS STUDIES
Watch in App
Join BYJU'S Learning Program
CrossIcon