program ex2_1 ! $Id: 2.1.f90 1.3 2025/07/13 09:29:08 s Exp $ ! a : the principal ! r : interet rate ! n : a number of years ! pv : present value implicit none character(len = 10) fm1, fm2 integer n real(8) a, r, pv ! input a = 1.0d0 r = 0.033d0 n = 2014 - 1776 ! calculation pv = a * (1.0d0 + r) ** n ! output fm1 = '(a5,f10.4)' fm2 = '(a5,i5)' write(*,*) 'input' write(*,fm1) 'a= ', a write(*,fm1) 'r= ', r write(*,fm2) 'n= ', n write(*,*) 'output' write(*,fm1) 'pv= ', pv end program ex2_1 ! end