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

Computer Science & Information Technology

You might also like to view...

What is the purpose of the Quick Access Toolbar?

What will be an ideal response?

Computer Science & Information Technology

Suppose you wish to study the relationship between the number of 'likes' on Facebook and the number of 'friends' one has on Facebook. Describe the statistical technique you would use.  ?

What will be an ideal response?

Computer Science & Information Technology