Question 6 What is the output of the following code? Assume the input is 10 30 16 25 76 -1 int num=0; int sum; int count=0; cin >> sum; while (count < 3) cin >> num; sum = sum + num; count++; cout << "Sum ="<< sum; Question 7 What is the output of the following code? Assume the input is 25 36 18 16 -1 int num: int sum; cin >> sum: num = sum while (num l= -1) cin >> num: sum = sum + num: cout << "Sum = "<< sum:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter7: User-defined Simple Data Types, Namespaces, And The String Type
Section: Chapter Questions
Problem 1TF
icon
Related questions
Question
Can anyone tell me the outputs for these questions For 6 I already tried 81 and 7 94 already
O Pearson Sign In
Introduction To Elec...
G SOLVED:Two bump..
5 Calculus, 11th Edition
SOLVED
cout << ch;
Question 6
What is the output of the following code?
Assume the input is 10 30 16 25 76 -1
int num=0;
int sum;
int count=0;
cin >> sum;
while (count < 3)
cin >> num;
sum = sum + num;
count++;
cout << "Sum = "<< sum:
Question 7
What is the output of the following code?
Assume the input is 25 36 18 16 -1
int num:
int sum;
cin >> sum
num = sum
while (num != -1)
cin >> num;
sum = sum + num:
cout << "Sum = "<< sum:
earch
立
Transcribed Image Text:O Pearson Sign In Introduction To Elec... G SOLVED:Two bump.. 5 Calculus, 11th Edition SOLVED cout << ch; Question 6 What is the output of the following code? Assume the input is 10 30 16 25 76 -1 int num=0; int sum; int count=0; cin >> sum; while (count < 3) cin >> num; sum = sum + num; count++; cout << "Sum = "<< sum: Question 7 What is the output of the following code? Assume the input is 25 36 18 16 -1 int num: int sum; cin >> sum num = sum while (num != -1) cin >> num; sum = sum + num: cout << "Sum = "<< sum: earch 立
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr