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);
}- A$13.25,4.5$
- B$1.5,3.5$
- C$13.24,1.5,4.5,5.4,3.5$
- DIllegal use of pointer in main functionCorrect 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.