Answer to Question #100843 in C++ for zahra

Question #100843
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 do while
1
Expert's answer
2020-01-03T09:36:00-0500
#include <iostream>
using namespace std;

void main()
{
  int i=1;
  int sum =0;
  do{
   if (i%7==0)
   {
    cout <<i << “ ”;
    sum+=i;
   }
i++;
  }while(i<100);
  cout <<endl <<“sum =”<<sum;
}




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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS