chap03/kadai5.f90
1program answer
2 implicit none
3
4 real(8), parameter :: c1 = +1.0_8
5 real(8), parameter :: c3 = -c1 / (3 * 2 * 1)
6 real(8), parameter :: c5 = -c3 / (5 * 4)
7 real(8), parameter :: c7 = -c5 / (7 * 6)
8 real(8) :: x
9
10 read(*, *) x
11
12 write(*, *) c1 * x
13 write(*, *) c1 * x + c3 * x**3
14 write(*, *) c1 * x + c3 * x**3 + c5 * x**5
15 write(*, *) c1 * x + c3 * x**3 + c5 * x**5 + c7 * x**7
16 write(*, *) sin(x)
17
18 stop
19endprogram answer