Postlab02_Task2_rfelde - program det implicit none Declare...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
! Lab #2: Fortran Basics ! File: Postlab02_Task2_rfelde.f95 ! Date: 17 January 2008 ! By: Ryan Robert Felde ! rfelde ! Section: 02/01, 11:30, and ENAD 138 ! Team: 16 ! ! ELECTRONIC SIGNATURE ! Ryan Robert Felde ! ! The electronic signature above indicates the program submitted for ! evaluation is my individual work and I have a general understanding ! of all aspects of its development and execution. ! ! A BRIEF DESCRIPTION OF WHAT THE PROGRAM OR FUNCTION DOES ! This program asks for the values of a, b, and c and tells whether or not ! the function has no roots, one root, or two roots.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

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.

Ask a homework question - tutors are online