Q1/ Given the input data 25 10 6 -1 What is the output of the following fragment
ID: 3529754 • Letter: Q
Question
Q1/ Given the input data 25 10 6 -1 What is the output of the following fragment? (All variables are of type int.) sum = 0; NL cin >> number; NL while (number !=-1) NL { NL cin >> number; NL sum = sum + number; NL } NL cout << sum << endl; what is the output? Q2/ sum = 0; NL cin >> number; NL while (number !=-1) NL { NL sum = sum + number; NL cin >> number; NL } NL cout << sum << endl; what is the output? (The NL Means that in the new line under the one before it because I can't type it here as I see it ) Q3 write a For loop statement that counts aand displays the numbers from -10 to 10. use the integer variable named count as the counter. Q4/ what is output by the following code segment? for ( int outCount < 3; outCount++ ) for ( int inCount = 3; inCount > 1; inCount--) cout << outCount << " " << inCount << endl; Q5/ What is the output of the following code fragment if the input value is 20? cin >> somelnt; NL if (somelnt > 30) NL cout << "Moe"; NL cout << "Larry "; NL cout << "curly"; what is the output?Explanation / Answer
answer-1 15
answer-2 41
answer-3
int count;
for(count=-10;count<=10;count++
{
cout<<count<<" ";
}
answer-4
1 3
1 2
2 3
2 2
answer-5
Larry curly
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.