What is the output of the following program? #include <stdio.h> void f00 (int…

2022

What is the output of the following program? #include <stdio.h> void f00 (int *P) { *P = 200; } int main() { int a = 100; f00(&a); printf("%d", a); return 0; }

  1. A.

    100

  2. B.

    200

  3. C.

    Compile time error

  4. D.

    Runtime error

Attempted by 595 students.

Show answer & explanation

Correct answer: B

Answer: 200 — the program prints 200. In main(), variable a is initialized to 100.

Explore the full course: Up Lt Grade Assistant Teacher 2025