GATE CS 2024 (Forenoon) — Question 48

Programming in CFunctions, Parameter Passing, Scope Rules, RecursionMSQ2 marksMedium

Consider the following C function definition.
c
1int f (int x, int y) {
2    for (int i = 0; i < y; i++ )
3        x = x + x + y;
4    return x;
5}
6
Which of the following statements is/are TRUE about the above function?
  1. A
    If the inputs are \( x = 20, y = 10 \), then the return value is greater than \( 2^{20} \)
  2. B
    If the inputs are \( x = 20, y = 20 \), then the return value is greater than \( 2^{20} \)
  3. C
    If the inputs are \( x = 20, y = 10 \), then the return value is less than \( 2^{10} \)
  4. D
    If the inputs are \( x = 10, y = 20 \), then the return value is greater than \( 2^{20} \)
Practise the full 2024-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAFree All-India Mock — every SundayA full GATE CS paper, exactly 180 minutes, ranked across India with your GATE score.
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