Programming - C Language
GATE CSE & IT · 5 questions across 3 years (2017-2025) · 8% recurrence rate
Recurrence sparkline
2017–2025Difficulty mix
Question types
All 5 questions on Programming - C Language
#include void foo(int *p, int x) { *p=x; } int main() { int *z; int a = 20, b = 25; z = &a; foo(z,b); printf("%d",a); return 0; } The output of the given C program is __________. (Answer in integer)
Consider the following C program: #include 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...
Consider the following C program: #include int main() { int a = 6; int b = 0; while (a < 10) { a = a / 12 + 1; a += b; } printf("%d", a); return 0; } Which one of the following statements is CORRECT?
Consider the following C function definition. int f(int x, int y) { for (int i=0; i<y; i++) { x=x+x+y; } return x; } Which of the following statements is/are TRUE about the above function?
Consider the C program fragment below which is meant to divide x by y using repeated subtractions. The variables x, y, q and r are all unsigned int. ```c while (r >= y) { r = r - y; q = q + 1; } ``` Which of the followin...