Menu

[solved] – Question 93035

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?
4)Which of the following will be correct in BlankD?

i = i + 1; term = term / (i+1); result = result + term;

result = result + term; i = i + 1; term = term / (i+1);

i = i + 1; result = result + term; term = term / (i+1);

term = term / (i+1); result = result + term; i = i + 1;

Expert Answer


OR


Leave a Reply

Your email address will not be published. Required fields are marked *