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

Computer Science & Information Technology

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)

Computer Science & Information Technology

What does the following program print?

``` 1 2 3 Mystery Script 4 5 20 21 22 ```

Computer Science & Information Technology

The Frame Relay switch is also called the ____.

A. FRAP B. PDN C. FRND D. FRAD

Computer Science & Information Technology

The number of characters in a String can be determined by sending it the ____ message.

A. length() B. substring() C. valueOf() D. subSequence()

Computer Science & Information Technology