What will be the output of the following code?

1.9 What will be the output of the following code?
void fun(int a[ ], int s)
{ a[0]=a[2]+a[2]; a[2]=a[0]+a[0];
a[1]=a[1]+s, a[3]=a[3]*a[3]; }
main() { int n[ ]={5,3,2,1}, size=4;
fun(n, size);
printf(“%d %d %d %d”, *n, n[1], n[2], n[3]); }
A) 5 3 2 1
B) Syntax error
C) 5 7 8 1
D) 4 7 8 1


Leave a Reply