1. At which index, will the last element in the array int A[5] will be stored ? A) 5 B) 4 C) 0 D) Undefined

Answer : B

  1. What is the correct way to declare a pointer in C? A) int p* = &A B) int *p = &A C) int *p = &A D) int &P = *A

Answer: C

  1. Which of the following is true for the following array declaration int arr[5] = {1, 2, 3};

A) It will result in a compilation error.
B) It initializes the first three elements as 1, 2, 3, and the rest will be default initialized to 0.
C) It initializes all elements to 1, 2, 3, and leaves the rest uninitialized.
D) It initializes the entire array with 1, 2, 3 repeatedly.

Answer: B

  1. In C, if a function is called before its declaration or definition, what is the assumed return type? A) int
    B) float
    C) void
    D) double
    Answer: A

  2. What will the following C code fragment print? `int a = 10, b = 15; printf(“%d”, a > b ? a : b);

A) 10
B) 15
C) 1
D) 0
Answer: B

  1. What does the following C function calculate? int function(int n) { if (n == 1) return 1; else return n * func(n - 1); }

A) n’th Fibonacci number
B) Factorial of n
C) Sum of first n natural numbers
D) n raised to the power of n

  1. In C programming, what does the sizeof operator return for a structure?

A) The size of the largest member of the structure.
B) The sum of the sizes of all members of the structure.
C) The number of bytes allocated for the structure in memory.
D) The number of elements in the structure.

Answer: C

  1. Which of the following dynamic memory management functions initialize the allocated variable to 0 by default A) malloc B) calloc C) free D) realloc

  2. What is the purpose of the strcmp() function in C?

A) Concatenates two strings
B) Compares two strings lexically
C) Copies one string to another
D) Searches for a substring within a string

Answer: B

  1. What does the continue statement do in a loop in C?

A) Exits the loop immediately
B) Skips the remaining code in the loop and continues with the next iteration
C) Skips the current iteration and starts the loop from the beginning
D) Breaks out of the loop

Answer: C

  1. Which of the following is not a fundamental data type in C A) Integer B) Float
    C) Long
    D) String

Answer: D

  1. Which searching algorithm divides the array into subarrays to perform the search recursively?

A) Linear search
B) Binary search
C) Interpolation search
D) Jump search

Answer: B

  1. Which of the following is true about the const keyword in C?

A) It makes a variable immutable.
B) It declares a constant.
C) It allocates memory dynamically.
D) It is used to define a new data type.

Answer : A

  1. Which data structure allows traversal in only one direction? A) Array B) Singly Linked list C) Stack D) Queue

  2. Which of the following statements about arrays in C is true? A) Arrays can store elements of different data types. B) The size of an array must be known at compile time. C) Arrays in C are always dynamically allocated. D) Arrays can only store a fixed number of elements.