πŸ“Š C Programming
Q. Which of the following shows the correct hierarchy of arithmetic operations in C
  • (A) / + * -
  • (B) * - / +
  • (C) + - / *
  • (D) * / + -
πŸ’¬ Discuss
βœ… Correct Answer: (D) * / + -
πŸ“Š C Programming
Q. What is an array?
  • (A) an array is a collection of variables that are of the dissimilar data type.
  • (B) an array is a collection of variables that are of the same data type.
  • (C) an array is not a collection of variables that are of the same data type.
  • (D) none of the above.
πŸ’¬ Discuss
βœ… Correct Answer: (B) an array is a collection of variables that are of the same data type.

Explanation:

In C language, an array is:

A collection of elements (variables), all of the same data type, stored in contiguous memory locations, and accessed using an index.

Example:

int numbers[5] = {1, 2, 3, 4, 5};
  • This is an array of 5 integers.
  • All elements are of type int.
  • Indexed from 0 to 4.

Evaluating the Options:

OptionExplanationCorrect?
(A) Collection of dissimilar data types❌ Incorrect – that would describe a structure (struct) 
(B) Collection of same data typeβœ… Correct 
(C) Not a collection of same data type❌ Incorrect 
(D) None of the above❌ Incorrect 

Final Answer: (B) An array is a collection of variables that are of the same data type. βœ…

πŸ“Š C Programming
Q. What is right way to Initialization array?
  • (A) int num[6] = { 2, 4, 12, 5, 45, 5 } ;
  • (B) int n{} = { 2, 4, 12, 5, 45, 5 } ;
  • (C) int n{6} = { 2, 4, 12 } ;
  • (D) int n(6) = { 2, 4, 12, 5, 45, 5 } ;
πŸ’¬ Discuss
βœ… Correct Answer: (A) int num[6] = { 2, 4, 12, 5, 45, 5 } ;
πŸ“Š C Programming
Q. An array elements are always stored in _________ memory locations.
  • (A) sequential
  • (B) random
  • (C) sequential and random
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) sequential
πŸ“Š C Programming
Q. What is the right way to access value of structure variable book{ price, page }?
  • (A) printf("%d%d", book.price, book.page);
  • (B) printf("%d%d", price.book, page.book);
  • (C) printf("%d%d", price::book, page::book);
  • (D) printf("%d%d", price->book, page->book);
πŸ’¬ Discuss
βœ… Correct Answer: (A) printf("%d%d", book.price, book.page);
πŸ“Š C Programming
Q. perror( ) function used to ?
  • (A) work same as printf()
  • (B) prints the error message specified by the compiler
  • (C) prints the garbage value assigned by the compiler
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) prints the error message specified by the compiler
πŸ“Š C Programming
Q. Bitwise operators can operate upon?
  • (A) double and chars
  • (B) floats and doubles
  • (C) ints and floats
  • (D) ints and chars
πŸ’¬ Discuss
βœ… Correct Answer: (D) ints and chars
πŸ“Š C Programming
Q. What is C Tokens?
  • (A) the smallest individual units of c program
  • (B) the basic element recognized by the compiler
  • (C) the largest individual units of program
  • (D) a & b both
πŸ’¬ Discuss
βœ… Correct Answer: (D) a & b both
πŸ“Š C Programming
Q. What is Keywords?
  • (A) keywords have some predefine meanings and these meanings can be changed.
  • (B) keywords have some unknown meanings and these meanings cannot be changed.
  • (C) keywords have some predefine meanings and these meanings cannot be changed.
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) keywords have some predefine meanings and these meanings cannot be changed.
πŸ“Š C Programming
Q. What is constant?
  • (A) constants have fixed values that do not change during the execution of a program
  • (B) constants have fixed values that change during the execution of a program
  • (C) constants have unknown values that may be change during the execution of a program
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) constants have fixed values that do not change during the execution of a program