Consider the following code fragment.

```
char str[10];
scanf("%s", str);
```

What will happen if scanf encounters the string "vivaciously" when scanning a value for str?

a. Since there is not enough room in str for the whole string, only "vivacious" will be stored in str.
b. Function scanf will store the entire string "vivaciously", even though there is insufficient space in str. The string will overflow str.
c. The program will abort with an error message.
d. Only "vivacious" will be scanned and stored, leaving "ly" on the input line.
e. None of the above.


b. Function scanf will store the entire string "vivaciously", even though there is insufficient space in str. The string will overflow str.

Computer Science & Information Technology

You might also like to view...

High-level languages are used to develop applications, games, Web apps, and most other software.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The Click to open Gradient Picker list arrow is located on the Options bar.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

In the accompanying figure of a Microsoft Word 2016 document, which of the following boxes is pointing to the Shading button arrow?? ?

A. ?Box A B. ?Box B C. ?Box C D. ?Box D

Computer Science & Information Technology

The oldest Telnet server, found on UNIX and Linux systems, is ____________________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology