2
When using visualG LOG there is a problem, I need to divide a value typed by the user, by log 2 in base 10. Only he doesn’t make it he’s wrong.
funcao menu_8():inteiro
var
logaritmo :real
inicio
para contador de 0 ate 12 faca
logaritmo <- ((log(i[contador])) / (log(2)))
se ((logaritmo % 2 = 0) OU (logaritmo % 2 = 1)) entao
escreva(" é Potencia de 2: ", i[contador])
fimse
fimpara
escreval(" ")
fimfuncao
after the IF function is executed and the result of the division is an INTEGER value, without comma, it prints the message, otherwise, it loops the repetition with another value of the vector, until it finds a number that is power 2, if none is, then it goes out and does not print anything.
what’s the easiest way to solve this?
Hi @Agenaro, saw my reply?
– Leo