1
GATE CSE 2025 Set 2
MCQ (Single Correct Answer)
+1
-0.33

Consider the following C program :

#include <stdio.h>
void stringcopy(char *, char *);
int main( ) {
    char a[30] = "@#Hello world!";
    stringcopy(a,a+2);
    printf("%s\n", a);
    return 0;
}
void sringcopy(char *s, char *t) {
    while(*t)
        *st++ = *t++;
}

Which ONE of the following will be the output of the program?

A
@\#Hello World!
B
Hello World!
C
ello World!
D
Hello World!d!
2
GATE CSE 2025 Set 2
Numerical
+1
-0
int x = 126, y = 105;
do{
   if(x > y) x = x - y;
   else y = y - x;
}while(x!=y);
printf('%d", x);

The output of the given C code segment is __________. (Answer in integer)

Your input ____
3
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 ____
4
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 ____
EXAM MAP