Q. An entire array is always passed by ___ to a called function.

  • (A) Call by value
  • (B) Call by reference
  • (C) Address relocation
  • (D) Address restructure
πŸ’¬ Discuss
βœ… Correct Answer: (B) Call by reference

Q. What is the output of C program with arrays and pointers.?

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

Q. What is the output of C program with arrays?

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

Q. What is the output of C Program with arrays.?

Code:
int main()
{
    int rollno[3]=[1001,1002,1003];
    printf("%d", rollno[1]);
}
  • (A) 1002
  • (B) 1003
  • (C) address of 1002
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

Q. What is the output of C program with arrays.?

Code:
int main()
{
   char grade={'A','B','C'};
   printf("%c", grade[0]);
}
  • (A) A
  • (B) B
  • (C) C
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

Q. What is the value of an array element which is not initialized?

  • (A) By default Zero 0
  • (B) 1
  • (C) Depends on Storage Class
  • (D) None of the above.
πŸ’¬ Discuss
βœ… Correct Answer: (C) Depends on Storage Class

Q. What happens when you try to access an Array variable outside its Size.?

  • (A) Compiler error is thrown
  • (B) 0 value will be returned
  • (C) 1 value will be returned
  • (D) Some garbage value will be returned.
πŸ’¬ Discuss
βœ… Correct Answer: (D) Some garbage value will be returned.

Q. Can we change the starting index of an array from 0 to 1 in any way.?

  • (A) Yes. Through pointers.
  • (B) Yes. Through Call by Value.
  • (C) Yes. Through Call by Reference
  • (D) None of the above.
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the above.

Q. What is the need for C arrays.?

  • (A) You need not create so many separate variables and get confused while using.
  • (B) Using a single Array variable, you can access all elements of the array easily.
  • (C) Code maintainability is easy for programmers and maintainers.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What is a multidimensional array in C Language?

  • (A) It is like a matrix or table with rows and columns
  • (B) It is an array of arrays
  • (C) To access 3rd tow 2nd element use ary[2][1] as the index starts from 0 row or column
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above