Consider the following code snippet. What will it print? int main() {
Consider the following code snippet. What will it print?
#include <stdio.h>
int main() {
char str[][10] = {"one", "two", "three"};
printf("%c\n", str[2][4]);
return 0;
}
Show answerHide answer
Correct answer: (B) e
Explanation
str[2] is "three" and indexing from 0 gives t(0), h(1), r(2), e(3), e(4), so str[2][4] is 'e'.