! p2_1.f90 ! $Id: p2_1.f90 1.1 2014/02/08 09:28:16 s Exp $ program p2_1 implicit none character(len=40) fm1,fm2 integer n real a,r,pv ! a : the principal ! r : interet rate ! n : a number of years ! pv : present value ! input a=1.0 r=0.033 n=2014-1776 ! calculate pv=a*(1.0+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(*,*) 'result' write(*,fm1) 'pv= ', pv stop end program p2_1 ! end