0
This is the algorithm that I have been able to develop so far in portugol:
programa {
funcao inicio() {
inteiro n1, soma ,div,div2
escreva("digite um numero")
leia(n1)
para(inteiro i=1 ;i < n1 ; i++) {
para(inteiro p =1 ; p < i ;p ++) {
div= i/p
div2=i-(div*p)
se(div2 == 0) {
escreva(i,"\n")
}
}
}
}
}
A natural prime number has only two distinct natural divisors: the number one and itself. Since any number is always divisible by 1 and by itself, a natural number n will be prime if there is no divisor between 2 and n-1. Use % operator (Rest of entire division).
– anonimo
I can’t use modules
– Naruto senin
I have to do it hard but I can’t do the check
– Naruto senin