Question discussion

What is the output of following C program?#include int main() { int x = 8, *y, z; y = &x; printf("%d\n", x * *y * x + *y); return 0; }

3301Medium DSSSB TGT Computer Science 0 replies 2 views
0

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;
}
  • A8
  • BRuntime error
  • C520
  • DCompilation error
Correct answer: C

Explanation

x * *y * x + *y = 8 × 8 × 8 + 8 = 520.

Discussion 0

Nobody has replied yet. Start the discussion!