What is the effect of the following code fragment?

```
int num1 = 2;
int num2;
cin >> num2;
if ( num2 % num1 == 0 )
cout << "first option" << endl;
else
cout << "second option" << endl;
```
a. assigns the character "%" to the variable num2 if num1 is 0, and displays first option
b. displays first option if num1 and num2 are equal to 0, and second option otherwise
c. displays first option if an even number is entered as input, and second option if an odd number is entered as input
d. displays first option if num1 and num2 are equal and second option otherwise


c. displays first option if an even number is entered as input, and second option if an odd number is entered as input

Computer Science & Information Technology

You might also like to view...

Which of the following will not help prevent infinite loops?

a. Include braces around the statements in a do...while statement. b. Ensure that the header of a for or while statement is not followed by a semicolon. c. If the loop is counter-controlled, the body of the loop should increment or decrement the counter as needed. d. If the loop is sentinel-controlled, ensure that the sentinel value is input eventually.

Computer Science & Information Technology

What occurs if multiple kernel control paths concurrently attempt to acquire the same spin lock?

What will be an ideal response?

Computer Science & Information Technology

Determine the output of the below query. SELECT RPAD(ROUND('78945.45'),10,'*') FROM dual;

A. The function RPAD cannot be nested with other functions B. 78945.45**** C. 78945***** D. **78945.45

Computer Science & Information Technology

When using the ulimit tool, the ____________________ option is used to view the current limits.

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

Computer Science & Information Technology