program main
 implicit none 
 integer :: n,i 
 real :: prod =1.0,x 
 print*,"enter the value of x"
 read*, x 
  print*,"enter the value of n"
  read*,n 
  if (n==0)then 
  prod = 1.0 
  else if (n>0)then 
  do i = 1,n 
  prod = prod*x 
  end do 
  else 
  n = n*(-1.0)
do i= 1,n 
prod = prod*x 
end do 
prod =1/prod 
end if 
print*, "product", prod 
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: