Answer to Question #100830 in C++ for zahra
2019-12-27T03:46:07-05:00
Write a program that will display all numbers multiple of 7 which are between 1 and 100 and display the cumulative sum as well as the final sum solve with while
1
2020-01-02T10:24:37-0500
#include <iostream>
using namespace std;
int main()
{
const int NUM = 7;
int i = 1;
int sum = 0;
while (NUM * i < 100)
{
sum += NUM * i;
cout << NUM * i << " ";
i++;
}
cout << "\n" << sum;
return 0;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS !
Learn more about our help with Assignments:
C++
Comments
Leave a comment