I have a problem with Visual G. It's a college exercise (ADS - 1st Semester).
I need to create a even or odd number identifier, however, without using MOD
, division or multiplication, just addition and subtraction, and only with the commands Escreva
/ Escreval
, leia
, se
entao
and senao
. I've tried in many ways but so far it has not worked.
Can anyone help me? Here is my code:
Var
num:inteiro
Inicio
escreva("Olá usuário, digite um número: ")
leia (num)
se num +2 = 2,4,6,8,0 entao
escreva("Este número é par!")
senao
escreva("Este número é impar!")
fimse
Fimalgoritmo