Академический Документы
Профессиональный Документы
Культура Документы
2. How many times can the user input 4 before the loop exits
delta = 10
1st time input: 4 delta = 9, 14
2nd time input: 4 delta = 13, 18
3rd time input: 4 delta = 17, 22
The user can input 4 three times
3. What value(s) the user need to input to display the value for delta?
Any number except 3, 4, and 8
j < 4 + j == 5 * i >= k for i = 10, j = 3, and k = 20
3 <4 + 3 == 5 * 10 >= 20
3 <4 + 3 == 50 >= 20
3 < 7 == 50 >= 20
T == T —> T
Which of the following operators takes only integer operands?
a) +
b) *
c) /
d) %
If p is a Boolean variable, which of the following logical expressions always has the value FALSE?
a) p && p
b) p || p
c) p && !p
d) p || !p
e) b and d above
What the following code fragment prints
for (int i = ; i < 5; i++)
if (i == 3) continue;
else printf (“%d ”, i);
Answer: 1 2 4
Which of the following statements about C++ main function is False?
b)Program execution begins with the first executable statement in the main function.
c)The main function must call (invoke) at least one other function.
d)The word int in the function heading means that the main function returns an integer
VU’