C Prime factor of a given integer
write(*,*)'Input an integer:'
read(*,*)n
write(*,*)'The prime factor(s) of the integer is given below:'
do i=2,n
r=mod(n,i)
if (r.ne. 0.0)goto 10
do j=2,i/2
if(mod(i,j).eq.0)goto 10
end do
write(*,*)i
10 end do
end
write(*,*)'Input an integer:'
read(*,*)n
write(*,*)'The prime factor(s) of the integer is given below:'
do i=2,n
r=mod(n,i)
if (r.ne. 0.0)goto 10
do j=2,i/2
if(mod(i,j).eq.0)goto 10
end do
write(*,*)i
10 end do
end
Comments
Post a Comment