1
GATE CSE 2025 Set 2
Numerical
+2
-0
Consider the following C program :
#include <stdio.h>
int main( ) {
int a;
int arr[5]={30,50,10};
int *ptr;
ptr = &arr[0] + 1;
a = *ptr;
(*ptr)++;
ptr++;
printf("%d",a + (*ptr) + arr[1]);
return 0;
}
The output of the above program is _________. (Answer in integer)
Your input ____
2
GATE CSE 2025 Set 2
Numerical
+2
-0
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)
Your input ____
3
GATE CSE 2025 Set 1
Numerical
+2
-0
#include <stdio.h>
int foo(int S[ ], int size) {
if(size == 0) return 0;
if(size == 1) return 1;
if(S[0]!=S[1]) return 1 + foo(S + 1, size - 1);
return foo(S + 1, size - 1);
}
int main( ) {
int A[] ={0,1,2,2,2,0,0,1,1};
printf("%d", foo(A, 9));
return 0;
}
The value printed by the given C program is _________. (Answer in integer)
Your input ____
4
GATE CSE 2025 Set 1
Numerical
+2
-0
Consider the following C program :
#include < stdio.h>
int gate (int n) {
int d, t, newnum, turn;
newnum = turn = 0; t=1;
while (n>= t) t*= 10;
t/=10;
while (t>0) {
d=n/t;
n=n%t;
t/= 10;
if (turn) newnum = 10*newnum + d;
turn = (turn + 1) % 2;
}
return newnum;
}
int main( ) {
printf("%d", gate(14362));
return 0;
}
The value printed by the given C program is _________. (Answer in integer)
Your input ____
Questions Asked from Basic of Programming Language (Marks 2)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE 2025 Set 2 (2)
GATE CSE 2025 Set 1 (2)
GATE CSE 2024 Set 2 (1)
GATE CSE 2023 (1)
GATE CSE 2022 (1)
GATE CSE 2019 (1)
GATE CSE 2015 Set 1 (1)
GATE CSE 2014 Set 2 (2)
GATE CSE 2013 (1)
GATE CSE 2008 (1)
GATE CSE 2003 (2)
GATE CSE 2001 (2)
GATE CSE 1999 (3)
GATE CSE 1998 (1)
GATE CSE 1997 (1)
GATE CSE 1996 (1)
GATE CSE 1994 (1)
GATE CSE 1990 (2)
GATE CSE 1989 (2)
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages