2
In the algorithm below, visualg says: I expected REAL type expression. This always happens when I type 1.88 or any number with decimals in the variable (a). But the variable is not integer as you can see. How can I fix this? Thank you!
algoritmo "CALCULOIMC"
var
M, A, IMC: Real
inicio
Escreva("Massa (KG): ")
Leia(M)
Escreva ("Altura (m): ")
Leia(A)
IMC <- M / (A ^ 2)
Escreval ("IMC: ", IMC)
fimalgoritmo
I did a test with your example and did not generate exception, maybe it is the version of visualg, see if there is an update.
– Daniel Mendes
Fabio, I had the same problem. I closed and opened Visualg and it started working again. It must be some BUG. Abs
– Leo Camargo