Relational expression mixes character with numeric data

when I compile my program with pgf95 it gives error for this line:

error is : Relational expression mixes character with numeric data

but pgf77 does not? why is that?

I have to declare character ANS*1 then pgf95 does not give error. Implicit none is defined in the main program.

but why is that pgf95 gives error whereas pgf77 compiles fine?

There is insufficient information in your post to answer your questions, but one can make a guess:

An IMPLICIT NONE declaration applies only to the program unit (main program, subroutine or function) in which it is contained. It does not apply to any other program unit, even in the same source file.

Without IMPLICIT NONE, default variable typing makes ANS a real variable, and that explains the error message that you received.

The compiler option -Mdclchk may be used to locate implicitly typed variables.

The Fortran 77 and 9X standards do not allow comparing a character expression to a noncharacter expression. The PGI F77 compiler does not flag such a comparison unless the -Mstandard compiler option is used.