program main
implicit none 
integer :: i,n,f 
print*, "enter the value of n"
read*, n
f = 1
do i = 1,n 
f = f*i
end do 
print*, "factorial=",f
end program main

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: