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
