- #1
Luke1986
- 2
- 0
Homework Statement
IMPLICIT NONE
REAL :: A, B, C, DISCR, X1, X2, x1i, x2i
CHARACTER(3)::ANS,ANS1
! Reads the coefficients for the quadratic equation
33 WRITE(*,*)")"Please enter a *REAL*NUMBER* coefficient ( A )."
READ(*,*)A
WRITE(*,*)"Please enter a *REAL*NUMBER* coefficient ( B )."
READ(*,*)B
WRITE(*,*)"Please enter a *REAL NUMBER* coefficient ( C )."
READ(*,*)C
WRITE(*,*)"The coefficients for A,B,C are",A,B,C
Homework Equations
This is only a little part of the whole program. My question is when I input a invalid character, like a letter or symbol, I want to tell the user that it is a error. Since A,C,B are all real variables how do I ask If I can let the user reenter a new value. Maybe an If statement? But I think you cannot compare reals and character. I am new to fortran my prof keeps failing me its my 4th time taking this course. It is very hard for me to comprehend so much details. Can someone assist me please? thank you!