Consider the following C program. Assume parameters to a function are…
PYQ GATE 2024
Consider the following C program. Assume parameters to a function are evaluated from right to left.
#include <stdio.h>
int g(int p) { printf("%d", p); return p; }
int h(int q) { printf("%d", q); return q; }
void f(int x, int y) {
g(x);
h(y);
}
int main() {
f(g(10),h(20));
}
Which one of the following options is the CORRECT output of the above C program?
- A.
20101020
- B.
10202010
- C.
20102010
- D.
10201020
Attempted by 337 students.
Sign up free to check your answer
Sign up freeLoading lesson…

