Fortran Logical Constant Question Help please!?

Hi guys.

I would like to ask a question regarding this code

What will be output of the following program?

INTEGER M,N

M =6

N =8

IF (M.LT.N) THEN

M=M+2

IF (N.LT.M) THEN

PRINT*, M**2, N**2

ELSEIF (M.GT.N) THEN

PRINT*,M+, N+1

ELSE

PRINT*, M+1,N+2

ENDIF

ELSE

PRINT*, M,N,M-N

ENDIF

END

Now the first condition is TRUE so M new value will be M=6+2 =8

So when I move on to the next condition am I going to consider M as 6 or 8?

Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Answers & Comments


Helpful Social

Copyright © 2024 Q2A.ES - All rights reserved.