What is the output of following C program? int main()
What is the output of following C program?
#include<stdio.h>
int main()
{
int x = 8, *y, z;
y = &x;
printf("%d\n", x * *y * x + *y);
return 0;
}
Show answerHide answer
Correct answer: (C) 520
Explanation
y points to x, so *y = 8. x * *y * x + *y = 8 × 8 × 8 + 8 = 512 + 8 = 520.