0
How we get 89 in the output ???
#include <stdio.h> int main() { int x, y; char text[20]; scanf("%2d %d %*f %5s", &x, &y, text); /* input: 6789 1.5 elephant */ printf("%d %d %s", x, y, text); /* output: 67 89 eleph */ return 0; }
2 Respuestas
0
%2d reads only 2 digits, meaning it will be 67. The second one reads the next integer, which is 89, and so on
0
Thanks