Skip to main content

INTDIV2.F95

	PROGRAM INTDIV2
!
!  Purpose: To demonstrate integer division using Fortran
!  (now using type conversion)
!
	IMPLICIT NONE
	INTEGER:: I,J	! Used for holding two integers
	REAL:: X	! Used for holding result of division
!
	WRITE(*,*)'Enter an integer'
	READ(*,*)I
	WRITE(*,*)'Enter a second integer'
	READ(*,*)J
	X=REAL(I)/REAL(J)
	WRITE(*,*)'The ratio of these two integers is ',X
	STOP
	END PROGRAM INTDIV2