What does the following C function do?

```
int
fun(const char *string)
{
char blank = ' ';
int k;
int looking = 1;

k = strlen(string);
while (k >= 0 && looking) {
if (string[k] == blank)
--k;
else
looking = 0;
}

if (looking)
return (-1);
else
return (k);
}
```

a. It finds the subscript of the first nonblank character in string.
b. It finds the subscript of the last nonblank character in string.
c. It counts the nonblank characters in string.
d. It finds the subscript of the first blank in string.
e. It finds the subscript of the last blank in string.


b. It finds the subscript of the last nonblank character in string.

Computer Science & Information Technology

You might also like to view...

Which of the following statements is false?

a. The command window in Windows is called a Command Prompt. b. The command window in OS X is called a Terminal. c. The command window in Linux is called the shell. d. All of the above are true.

Computer Science & Information Technology

There are four basic types of password attacks.

Indicate whether the statement is true or false.

Computer Science & Information Technology

In the Save As dialog box, you can click a drive or folder in the ____ or the navigation pane to go directly to that location.

A. status bar B. Quick Access toolbar C. Save as type list D. Address bar

Computer Science & Information Technology

Which of the following processes ensures that aproject meets the identified quality standards?

a. Quality testing b. Quality planning c. Quality assurance d. Quality forecast

Computer Science & Information Technology