If abc, is the input, then the following program fragment char x, y, z;

  • 0 replies
  • 277 views
*

Offline mechanic

  • *****
  • 2490
    • View Profile
    • Engineering Forum
Question: If abc, is the input, then the following program fragment

char x, y, z;
printf{"&d", scanf ("%c%c%c", &x, &y, &z)}; results in

Options are:

A. a syntax error
B. a fatal error
C. segmentation violation
D. printing of 3

Correct answer is:

D. printing of 3