What is accomplished by the call to sprintf in the code fragment below?
```
char ans[20];
int num = 40;
sprintf(ans, "%d to %d", num, num + 10);
```
a. Nothing, the function name is misspelled.
b. It returns as its value the string "40 to 50".
c. It displays first the value of ans and then the string "40 to 50" (without the quote marks).
d. It aborts because the value of ans is garbage.
e. None of the above.
B
You might also like to view...
A PC power supply adjusts the 110-volt AC, found in your office or home, to the various alternating current levels required by a PC.
Answer the following statement true (T) or false (F)
What does the following program print?
``` 1 2 3
The Frame Relay switch is also called the ____.
A. FRAP B. PDN C. FRND D. FRAD
The number of characters in a String can be determined by sending it the ____ message.
A. length() B. substring() C. valueOf() D. subSequence()