ProgrammingVery hard

char s[10], w[10]; int n = 0; sscanf("abc123", "%[a-z]%d", s, &n); printf("%d", n); What is printed?

  1. A. 2
  2. B. abc
  3. C. 0
  4. D. 123

Correct answer: D. 123

The %[a-z] conversion reads 'abc' into s, and %d reads 123 into n. The printed value is 123.

More C Programming questions

Exams that ask this topic