I'm using Portugol Studio to study algorithms in English. And I have a difficulty in an issue that the teacher has passed.
The question is as follows:
Create an algorithm that prompts the user to enter 10 numbers any integers. Print the sum of the numbers you typed.
My algorithm looks like this:
programa
{
inteiro cont=0, numero, soma=0
funcao inicio()
{
enquanto (cont<3)
{
cont++
escreva ("Digite um número inteiro: ")
leia (numero)
limpa()
}
soma = soma+numero
escreva ("\nA soma é: ", soma)
}
}
But it does not return the exact sum.