The next few questions are for the program given below. You need to fill in the blanks as per the plan given in the comments. The program is supposed to calculate the value of e (Euler's number/constant used in mathematics).
main_program{
int n; cin >> n;
double i= BlankA, term = BlankB, result = BlankC;
repeat(n){// On tth entry, t=1..n
// i=t-1, term=1/t!
// result=1/0!+..+1/(t-1)!
BlankD
}
cout << result << endl;
}
1.What is BlankA?
2.What is BlankB?
3.What is BlankC?
Which of the following will be correct in BlankD?
1.i = i + 1; term = term / (i+1); result = result + term;
2.result = result + term; i = i + 1; term = term / (i+1);
3.i = i + 1; result = result + term; term = term / (i+1);
4.term = term / (i+1); result = result + term; i = i + 1;
Answers
Answered by
0
Answer:
I love the codings but I don't know the answers
Similar questions