Question 91Asked in BPSC TRE 3.0 (2024) Computer Science Class 11-12

Write the output of the following program: int a[ ] = {1,2,3,} *p;

Write the output of the following program: int a[ ] = {1,2,3,} *p;
  1. AJunk value
  2. B3
  3. CRuntime error
  4. DMore than one of the above
  5. ENone of the above
Show answerHide answer

Correct answer: (E) None of the above

Explanation

The fragment int a[] = {1,2,3,} *p; is missing a separator before *p, so it will not compile. It gives neither a junk value, 3, nor a runtime error.

From BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper

This is question 91 of BPSC TRE 3.0 (2024) Computer Science Class 11-12 — Previous Year Paper. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.