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...

Application templates are used to create basic Android applications that will work on only specific screen sizes.

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

Computer Science & Information Technology

What is the name of the color mode that contains predefined colors that are coded so as to be recognized by most computer displays and by the common web browser applications?

What will be an ideal response?

Computer Science & Information Technology