Unformatted text preview: program det implicit none ! Declare Variables real :: A, B, C, D logical :: X, Y, Z !Ask the user for the values of A, B, and C and read these in write(*,*) 'Enter values for A, B, and C:' read(*,*) A, B, C !Calculate the determinant based on the input values D = b**2 - (4*A*C) !Test to see if the determinant is less than, equal to, or greater than !zero X = (D < 0) Y = (D == 0) Z = (D > 0) !Display the results of the logical statements write(*,*) 'No real roots:', X write(*,*) 'One real root:', Y write(*,*) 'Two real roots:', Z stop end program...
View Full Document
This note was uploaded on 10/05/2009 for the course ENGR 117 taught by Professor Staff during the Spring '08 term at Purdue.
- Spring '08
- Computer Programming