🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Arrays and Strings: all 10 questions

Quiz: C Arrays and Strings · Question 6 of 10

What does this print? (code)

What does this print?

#include <stdio.h>
int main(void) {
    int a[2][3] = {{1, 2, 3}, {4, 5, 6}};
    printf("%d %d\n", a[1][0], a[0][2]);
    return 0;
}
  1. A.2 4
  2. B.4 3
  3. C.4 2
  4. D.1 6
Answer & explanation

Correct answer: 4 3

a[1][0] is row 1, column 0 (4); a[0][2] is row 0, column 2 (3).

Can you get the rest right without peeking?

Take the timed Quiz: C Arrays and Strings quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →