ProgrammingHardWipro · Cognizant pattern

What is printed?

What is printed?
char *arr[] = {"one", "two", "three"};
char **p = arr;
printf("%s %c %s", *p, *(*(p + 1) + 1), p[2]);
  1. A. one t three
  2. B. two w three
  3. C. one w two
  4. D. one w three

Correct answer: D. one w three

*p is arr[0] = "one". p+1 points to arr[1]="two"; *(p+1) is "two", and +1 into it gives 'w'. p[2] is arr[2] = "three".

More C Programming questions

Exams that ask this topic