GATE CS 2025, set 2 · Question 63 · Programming and Data Structures · Numerical answer (NAT) · 2 marks · no negative marks
Consider the following C program:
#include <stdio.h> 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
Answer 46
Answer from the official GATE CS 2025 answer key.
The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes