Why do we have 2 variables with the same name in the program in question? What value does the program print? What should we do to get the value 15 printed? Thinking about variable scope, how do we classify the variable in row 4? And how do we classify the variable of line 8?
I have this code, and I need it to print the value 15, what should I do? Exercise of Portugol.
programa
{
inteiro valor = 15
funcao inicio()
{
inteiro valor = 10
escreva("valor=", valor)
}
}