Given the task:
Find the term of the sequence given by the formula Bi = 4 * Bi-1, for i> 1. The values of the first term in the sequence are entered by the user.
Pascal code was created to solve this problem, what would it look like in C ++?
Code example:
function B(a:real;i:integer):real; begin if i=1 then B:=a else B:=4*B(a,i-1); end; var a:real; n:integer; begin write('Первый член a='); readln(a); write('n='); readln(n); writeln(B(a,n):0:3); end.
begin...endwill be braces{}andvarshould not be written - slippyk