Free Practice / PYQ

GATE CSE C Programming Practice Test – Array & Pointer | Set 1

Questions 6-10 of 100

Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 6

MCQ · Single Correct 1 mark

If 'a' is a 2D array of size 3x4 of type float, which of the following expressions is equivalent to 'a[2][3]'?

Answers for question 6

💡 Right-click an option to strike it out

Question 7

MCQ · Single Correct 1 mark

What does the expression 'sizeof(arr) / sizeof(arr[0])' calculate when applied to an array declared in the same scope as 'int arr[10];'?

Answers for question 7

💡 Right-click an option to strike it out

Question 8

MCQ · Single Correct 1 mark

What happens when you execute the statement 'free(ptr);' on a pointer allocated via 'malloc'?

Answers for question 8

💡 Right-click an option to strike it out

Question 9

MCQ · Single Correct 1 mark

What is the output of the following C program?

C
#include <stdio.h>
void fun(int *p) {
    *p = 50;
}
int main(void) {
    int val = 10;
    fun(&val);
    printf("%d", val);
    return 0;
}
Answers for question 9

💡 Right-click an option to strike it out

Question 10

MCQ · Single Correct 1 mark

Which function dynamically allocates memory on the heap and initializes all allocated bytes to zero?

Answers for question 10

💡 Right-click an option to strike it out

Scroll to Top