FoRtRaN
Thursday, November 25, 2010
write a program to find the factorial of a given number (using goto command)
implicit double precision (a-h,o-z)
iprod=1
i=1
write(*,*) 'n'
read(*,*) n
10 if(i.LE.n) then
iprod=iprod*i
i=i+1
goto 10
else
write(*,*) iprod
goto 20
20 endif
stop
end
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment