You are on page 1of 1

File: /home/himanshu/fortran/project1.

f95 Page 1 of 1

program project1

real y0,y1,g,l,h,t
integer i,k
y0=3.1415926/6
!print*, y0
y1=0
t=0.001
h=0.0001
g=9.8
l=1
k=10/h
i=0
do while(i<k)
write(1,*) t,y0
y0=y0+y1*h
y1=y1+f(y0,g,l)*h
i=i+1
t=t+h
end do
end program

function f(y0,g,l)
real y0,f,g,l
f=-sin(y0)*g/l
end function

You might also like