0
hello, I have to make an algorithm in visualg where you have to read from the keyboard a positive integer value and show on the screen all primes smaller than the number read from the keyboard, however, is being shown only the value typed if it is prime, below follows what I did:
Algorithm "without name"
Var
cont , x, v1, aux: inteiro
Inicio
escreval ("digite um valor")
leia (v1)
aux<-v1
repita
para x de 1 ate aux faca
se (v1%x=0) entao
cont<-cont+1
fimse
fimpara
se (cont=2) entao
escreval (v1)
fimse
v1<-v1-1
ate (v1<0)
Fimalgoritmo