GATE CS 2026 (Forenoon) — Question 34

Programming in CFunctions, Parameter Passing, Scope Rules, RecursionNAT1 markMedium

Consider the following program in C:
c
1#include <stdio.h>
2void func(int i, int j) {
3    if(i < j) {
4        int i = 0;
5        while (i < 10) {
6            j += 2;
7            i++;
8        }
9    }
10    printf("%d", i);
11}
12int main() {
13    int i = 9, j = 10;
14    func(i, j);
15    return 0;
16}
17
The output of the program is ________. (answer in integer) Note: Assume that the program compiles and runs successfully.
Practise the full 2026-FN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAThis week's 10-question challengeSame 10 past-GATE questions for everyone this week — see where you stand.
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