Suppose sum and num are int variables,and the input is 18 25 61 6 -1.What is the output of the following code?
sum = 0;
Cin >> num;
While (num != -1)
{
Sum = sum + num;
Cin >> num;
}
Cout << sum << endl;
A) 92
B) 109
C) 110
D) 119
Correct Answer:
Verified
Q1: Assume that all variables are properly declared.The
Q2: The following while loop terminates when j
Q3: What is the output of the
Q3: A(n) _-controlled while loop uses a bool
Q8: What is the output of the
Q10: Consider the following code.
int limit;
Int
Q11: What is the output of the
Q13: The number of iterations of a counter-controlled
Q14: The control variable in a flag-controlled while
Q17: In a sentinel-controlled while loop, the body
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents