GATE CS 2024 (Afternoon) — Question 13

Programming in CFunctions, Parameter Passing, Scope Rules, RecursionMCQ1 mark · −1/3 if wrongEasy

Consider the following C program. Assume parameters to a function are evaluated from right to left.
c
1# include <stdio.h>
2int g(int p) { printf ("%d", p); return p; }
3int h(int q) { printf ("%d", q); return q; }
4void f(int x, int y) {
5    g(x);
6    h(y);
7}
8int main( ) {
9    f(g(10), h(20));
10}
11
Which one of the following options is the CORRECT output of the above C program?
  1. A
    20101020
  2. B
    10202010
  3. C
    20102010
  4. D
    10201020
Practise the full 2024-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAWhat rank do your marks get?GATE score, likely All-India Rank and qualifying marks for your category.
Practise more on Functions, Parameter Passing, Scope Rules, RecursionTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group