Q. How is search done in #include and #include “somelibrary.h” according to C standard?

  • (A) When former is used, current directory is searched and when latter is used, standard directory is searched
  • (B) When former is used, standard directory is searched and when latter is used, current directory is searched
  • (C) When former is used, search is done in implementation defined manner and when latter is used, current directory is searched
  • (D) For both, search for ‘somelibrary’ is done in implementation-defined places
πŸ’¬ Discuss
βœ… Correct Answer: (D) For both, search for ‘somelibrary’ is done in implementation-defined places

Q. How many number of pointer (*) does C have against a pointer variable declaration?

  • (A) 7
  • (B) 127
  • (C) 255
  • (D) No limits
πŸ’¬ Discuss
βœ… Correct Answer: (D) No limits

Q. Which of the following is not possible statically in C language?

  • (A) Jagged Array
  • (B) Rectangular Array
  • (C) Cuboidal Array
  • (D) Multidimensional Array
πŸ’¬ Discuss
βœ… Correct Answer: (A) Jagged Array
Explanation:

The correct answer is: (A) Jagged Array

Explanation:

In C language, array dimensions and sizes must be known at compile time for static allocation.

Let’s look at the options:

(A) Jagged Array – ❌ Not possible statically

  • A jagged array (also known as an "array of arrays" where each sub-array can have different lengths) is not possible statically in C.
  • C supports arrays of pointers to achieve jagged arrays dynamically, but you cannot declare a jagged array statically since each row would need to have a different size, and static arrays in C require fixed dimensions.

Example (dynamic jagged array):

int *arr[3];
arr[0] = malloc(2 * sizeof(int)); // 2 elements
arr[1] = malloc(4 * sizeof(int)); // 4 elements
arr[2] = malloc(3 * sizeof(int)); // 3 elements

(B) Rectangular Array – βœ… Possible statically

  • A typical 2D array with the same number of columns in each row.
int arr[3][4]; // 3 rows, 4 columns

(C) Cuboidal Array – βœ… Possible statically

  • A 3D array (same size for all dimensions).
int arr[3][4][5]; // 3 layers of 4x5

(D) Multidimensional Array – βœ… Possible statically

  • General term for arrays with 2 or more dimensions.
  • C supports statically declared multidimensional arrays:
int arr[2][3][4]; // 3D

Final Answer: (A) Jagged Array

Q. Which of the following return-type cannot be used for a function in C?

  • (A) char *
  • (B) struct
  • (C) void
  • (D) none of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) none of the mentioned

Q. The standard header _______ is used for variable list arguments (…) in C.

  • (A) <stdio.h >
  • (B) <stdlib.h>
  • (C) <math.h>
  • (D) <stdarg.h>
πŸ’¬ Discuss
βœ… Correct Answer: (D) <stdarg.h>

Q. When a C program is started, O.S environment is responsible for opening file and providing pointer for that file?

  • (A) Standard input
  • (B) Standard output
  • (C) Standard error
  • (D) All of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the mentioned

Q. In C language, FILE is of which data type?

  • (A) int
  • (B) char *
  • (C) struct
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… Correct Answer: (C) struct

Q. What is the sizeof(char) in a 32-bit C compiler?

  • (A) 1 bit
  • (B) 2 bits
  • (C) 1 Byte
  • (D) 2 Bytes
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1 Byte

Q. Which of the following is not an operator in C?

  • (A) ,
  • (B) sizeof()
  • (C) ~
  • (D) None
πŸ’¬ Discuss
βœ… Correct Answer: (D) None

Q. scanf() is a predefined function in______header file.

  • (A) stdlib. h
  • (B) ctype. h
  • (C) stdio. h
  • (D) stdarg. h
πŸ’¬ Discuss
βœ… Correct Answer: (C) stdio. h