ProgrammingHard

printf("%.*s", 2, "hello"); What is printed?

  1. A. hel
  2. B. h
  3. C. hello
  4. D. he

Correct answer: D. he

The * precision takes its value from the argument list, so only two characters are printed.

More C Programming questions

Exams that ask this topic