πŸ“Š C Programming
Q. Pick the best statement for the below program snippet:
Code:
struct {int a[2];} arr[] = {1,2};
  • (A) No compile error and it’ll create array arr of 2 elements. Each of the element of arr contain a struct field of int array of 2 elements. arr[0]. a[0] would be 1 and arr[1].a[0] would be 2.
  • (B) No compile error and it’ll create array arr of 2 elements. Each of the element of arr contain a struct field of int array of 2 elements. arr[0]. a[0] would be 1 and arr[0].a[1] would be 2. The second element arr[1] would be ZERO i.e. arr[1].a[0] and
  • (C) No compile error and it’ll create array arr of 1 element. Each of the element of arr contain a struct field of int array of 2 elements. arr[0]. a[0] would be 1 and arr[0].a[1] would be 2.
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (C) No compile error and it’ll create array arr of 1 element. Each of the element of arr contain a struct field of int array of 2 elements. arr[0]. a[0] would be 1 and arr[0].a[1] would be 2.

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
253
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
90%
Success Rate