Write a C program to find the sum of the integers 72 through

Write a C++ program to find the sum of the integers 72 through 410 inclusive. Display the resulting sum.

Solution

Sum.cpp

#include <iostream>

using namespace std;

int main()
{
int sum = 0;
  
for( int i=72 ;i<=410; i++){
sum = sum + i;
}
cout<<\"Sum is \"<<sum<<endl;
return 0;
}

Output:

Sum is 81699

Write a C++ program to find the sum of the integers 72 through 410 inclusive. Display the resulting sum.SolutionSum.cpp #include <iostream> using namespac

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site