Author Topic: If abc, is the input, then the following program fragment char x, y, z;  (Read 341 times)

Offline mechanic

Advertisement
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


Engineering Forum