Calculation of principal and interest and formula: a=P (1 + r)?
(p for principal, interest, r is n is deposit number, for the principal and interest and a) requires the use of circular structure,
CodePudding user response:
DECLARE @ p=5000.00MoneyDECLARE @ r Money=0.05
DECLARE @ a Money=5000.00
DECLARE @ n int=0
While @ a & lt; 10000.00
The BEGIN
The SET @ a *=(1 + @ r);
The SET @ n +=1
END
Print 'Total Year:' + Convert (Varchar (10), between (@ n))