Program with problem to compile

Asked

Viewed 99 times

1

I created this program to calculate the BMI, but it doesn’t run completely. He asks to enter with weight and height, but returns no result.

Could someone tell me what’s wrong?

PROGRAM Calc
 IMPLICIT NONE
 REAL :: peso, altura, mmc
 write(*,*) "Valor do peso = ? "
 read(*,*) peso
 write(*,*) "Valor do altura = ? "
 read(*,*) altura
 mmc = (peso/altura)
 write (*,*) mmc
 STOP
END PROGRAM Calc
  • After I enter the 2 input values, it does not print the result on the screen, simply closes the terminal

  • Which language and compiler is using ?

  • Force 2.0 Fortran 90

1 answer

2

Simply add a new READ at the end to wait for a key to be pressed before closing the code.

  • Another alternative is to run the program by the terminal, not by an IDE. (:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.