Question is to print the sum of numbers from 20-33 by using while loop using cpp | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Question is to print the sum of numbers from 20-33 by using while loop using cpp

Can anyone solve and send me

8th Sep 2019, 1:15 PM
Omkar Chavan
Omkar Chavan - avatar
4 Answers
+ 2
int sum = 0; for(int i = 20; i < 34; ++i){ sum = sum + i; }
8th Sep 2019, 1:18 PM
Marina Vasilyova
Marina Vasilyova - avatar
+ 2
summ wil store a summ from 22 to 33 include both numbers Firstly you add 22, then 23, then 24 and so on
8th Sep 2019, 9:58 PM
Marina Vasilyova
Marina Vasilyova - avatar
0
Maria Vasilyova can u explain what will sum will store. Because I understand that first i will use 20 to add but what is the sum used for
8th Sep 2019, 3:42 PM
Omkar Chavan
Omkar Chavan - avatar
0
Ok
9th Sep 2019, 5:05 AM
Omkar Chavan
Omkar Chavan - avatar