GATE CS 2025 Set 2 | Question 63

Programming & Data Structures › Functions · NAT · 2 marks · Answer: 46

  1. Question 63Programming & Data Structuresnat2 marks
    Consider the C program:
    int g(int n) { return (n+10); }
    int f(int n) { return g(n*2); }
    int main() {
        int sum, n;
        sum = 0;
        for (n=1; n<3; n++)
            sum += g(f(n));
        printf("%d", sum);
        return 0;
    }
    The output of the given C program is ________. (Answer in integer)

    Answer: 46

    Solution

    Answer: 46 , so . - . - .

More GATE PYQ on Functions

All GATE CS Programming & Data Structures PYQ →

Attempt GATE CS 2025 Set 2 in real GATE exam mode

Full paper with a timer, the GATE interface and a topic-wise analysis — free.

Create free account →