Q. What is an Array in C language.?

  • (A) A group of elements of same data type.
  • (B) An array contains more than one element
  • (C) Array elements are stored in memory in continuous or contiguous locations.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. Choose a correct statement about C language arrays.

  • (A) An array address is the address of first element of array itself.
  • (B) An array size must be declared if not initialized immediately.
  • (C) Array size is the sum of sizes of all elements of the array.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What are the Types of Arrays?

  • (A) int, long, float, double
  • (B) struct, enum
  • (C) char
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. An array Index starts with?

  • (A) -1
  • (B) 0
  • (C) 1
  • (D) 2
πŸ’¬ Discuss
βœ… Correct Answer: (B) 0

Q. Choose a correct statement about C language arrays.

  • (A) An array size can not changed once it is created.
  • (B) Array element value can be changed any number of times
  • (C) To access Nth element of an array students, use students[n-1] as the starting index is 0.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What is the output of C Program?

Code:
int main() { int a[]; a[4] = {1,2,3,4}; printf("%d", a[0]); }
  • (A) 1
  • (B) 2
  • (C) 4
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

Q. What is the output of C Program?

Code:
int main()
 { 
int a[] = {1,2,3,4}; 
int b[4] = {5,6,7,8}; 
printf("%d,%d", a[0], b[0]);
 }
  • (A) 1,5
  • (B) 2,6
  • (C) 0 0
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1,5

Q. What is the output of C Program?

Code:
int main()
 {
 char grade[] = {'A','B','C'}; 

printf("GRADE=%c, ", *grade); 

printf("GRADE=%d", grade);

 }
  • (A) GRADE=some address of array, GRADE=A
  • (B) GRADE=A, GRADE=some address of array
  • (C) GRADE=A, GRADE=A
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) GRADE=A, GRADE=some address of array

Q. What is the output of C program?

Code:
int main()
 {

 char grade[] = {'A','B','C'}; 

printf("GRADE=%d, ", *grade); 

printf("GRADE=%d", grade[0]);

 }
  • (A) A A
  • (B) 65 A
  • (C) 65 65
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) 65 65

Q. What is an array Base Address in C language.?

  • (A) Base address is the address of 0th index element.
  • (B) An array b[] base address is &b[0]
  • (C) An array b[] base address can be printed with printf("%d", b);
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above