Skip to content

UGC NET CS 2023Programming Languages and Computer Graphics › Programming in CVerified

UGC NET CS 2023 PYQ: What is the output of following code? main () { static float a[]=\{13.24,1.5,4.5,5.4,3.5} float * j, * k; j=…

What is the output of following code?

main ()
{ static float a[]=\{13.24,1.5,4.5,5.4,3.5}
float * j, * k;
j= a};
k= a + 4
j=j * 2;
k = k / 2;
printf ("% f % f",* j,*k);
}
  1. A
    $13.25,4.5$
  2. B
    $1.5,3.5$
  3. C
    $13.24,1.5,4.5,5.4,3.5$
  4. D
    Illegal use of pointer in main function
    Correct answer

Answer

(D) Illegal use of pointer in main function

Approach

Check which pointer operations are legal in C.

Reviewed by UGC IQ Editorial Team.