1
GATE CSE 2026 Set 2
MCQ (Single Correct Answer)
+1
-0

In C runtime environment, which one of the following is stored in heap?

A

A static variable declared inside a function

B

An array of integers declared inside a function

C

A dynamically allocated array of integers created using malloc() function call

D

Return address of a function

2
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!
3
GATE CSE 2024 Set 2
MCQ (More than One Correct Answer)
+1
-0

Consider the following C function definition.

 int fX(char *a) {

   char *b = a; 

   while(*b) 
        b++; 

   return b - a; }  

Which of the following statements is/are TRUE?

A

The function call fX("abcd") will always return a value

B

Assuming a character array c is declared as char c[] = "abcd" in main(), the function call fX(c) will always return a value

C

The code of the function will not compile

D

Assuming a character pointer c is declared as char *c = "abcd" in main(), the function call fX(c) will always return a value

4
GATE CSE 2022
MCQ (Single Correct Answer)
+1
-0.33

What is printed by the following ANSI C program?


#include <stdio.h>
int main(int argc, char *argv[ ]) {
   int x = 1, z[2] = {10, 11};
   int *p = NULL;
   p = &x;
   *p = 10;
   p = &z[1];
   *(&z[0] + 1) += 3;
   printf("%d, %d, %d\n", x, z[0], z[1]);
   return 0;
} 

A
1, 10, 11
B
1, 10, 14
C
10, 14, 11
D
10, 10, 14

GATE CSE Subjects

Browse all chapters by subject

Software Engineering
Web Technologies