Fill in the blanks to enter five numbers from the user and print their sum. Store the sum in the variable named total. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Fill in the blanks to enter five numbers from the user and print their sum. Store the sum in the variable named total.

int x = 1; int number; int total = 0; (x <= 5) { cin >> number; = total + number; x++; } cout << "Sum: " << << endl;

24th Aug 2017, 10:43 AM
Abdulhamid Babar
Abdulhamid Babar - avatar
4 Answers
+ 2
int x=1; int number; int total=0; while(x<=5){ cin>>number; total=total+number; x++; } cout<<"sum:"<<total<<endl;
12th Sep 2017, 6:58 AM
HASHIR IMAM
HASHIR IMAM - avatar
+ 1
answer is : 1.while 2.total 3.total
29th Mar 2021, 9:40 AM
v manojbabu
v manojbabu - avatar
0
int x=1; int number; int total=0; while(x<=5){ cin>>number; total=total+number; x++; } cout<<"sum:"<<total<<endl;
19th Dec 2020, 6:43 AM
KRUTIK RAUT
KRUTIK RAUT - avatar
0
while total total
17th Aug 2022, 7:41 AM
Lemmessa Welfana
Lemmessa Welfana - avatar