C Program to find prime numbers between two integers
write(*,*)'Enter the limits:'
read(*,*)m,n
if (m.gt.n)then
temp=m
m=n
n=temp
end if
i=m
print*,'The prime numbers between are given below:'
20 do j=2,i/2
r=mod(i,j)
if(r.eq.0)goto 10
end do
write(*,*)i
10 if(i.lt.n)then
i=i+1
goto 20
end if
end
write(*,*)'Enter the limits:'
read(*,*)m,n
if (m.gt.n)then
temp=m
m=n
n=temp
end if
i=m
print*,'The prime numbers between are given below:'
20 do j=2,i/2
r=mod(i,j)
if(r.eq.0)goto 10
end do
write(*,*)i
10 if(i.lt.n)then
i=i+1
goto 20
end if
end
Comments
Post a Comment