GATE CS 2025 (Afternoon) — Question 63

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

Consider the following C program:
c
1#include <stdio.h>
2int g(int n) {
3    return (n+10);
4}
5int f(int n) {
6    return g(n*2);
7}
8int main( ) {
9    int sum, n;
10    sum=0;
11    for (n=1; n<3; n++)
12        sum += g(f(n));
13    printf("%d", sum);
14    return 0;
15}
16
The output of the given C program is ________. (Answer in integer)
Practise the full 2025-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.
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