Write a C++ program to calculate scientifically the following summation using a
ID: 3626729 • Letter: W
Question
Write a C++ program to calculate scientifically the
following summation
using a variable of double type to keep the sum in the
program. The program should also display the final
result. Desk-check the first few steps of your
program while monitoring the relevant variable/s and
condition/s. These first few steps should include at
least the processing of the first 2 terms, i.e.
3/(1×2)+4/(2×3). For the desk-checking, please label
the lines or the statements of your C++ program explicitly.
Write a C++ program to calculate scientifically the
following summation
99 100
101
98 99
100
3 4
5
2 3
4
1 2
3
×
+
×
+ +
×
+
×
+
×
,
using a variable of double type to keep the sum in the
program. The program should also display the final
result. Desk-check the first few steps of your
program while monitoring the relevant variable/s and
condition/s. These first few steps should include at
least the processing of the first 2 terms, i.e.
3/(1×2)+4/(2×3). For the desk-checking, please label
the lines or the statements of your
Explanation / Answer
#include<iostream>
using namespace std;
int main()
{
double sum=0;
for(double i=3.0; i<102.0; i++)
{
sum = sum + (i/((i-2)*(i-1)));
if(i==4)
cout << " Sum is " << sum <<endl; // this equals to 3/1*2 + 4/2*3
}
cout << " Total sum of Series Given by " << sum <<endl;
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.