What happens if the following program is executed in C and C++? #include…

BPSC TRE 2023Modified — slightly modified from the official paper; see the solution

What happens if the following program is executed in C and C++? #include <stdio.h> int main(void) { int new = 5; printf("%d", new); }

  1. A.

    Error in C and successful execution in C++

  2. B.

    Error in both C and C++

  3. C.

    Error in C++ and successful execution in C

  4. D.

    More than one of the above

  5. E.

    None of the above

Attempted by 657 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rssb Senior Computer Instructor

Loading lesson…