1
I have the following question and cannot think of a solution:
Make an algorithm that reads the duration of an event in seconds and shows it expressed in hours, minutes and seconds.
My code:
algoritmo "Duração de Evento"
var
segundos, sec, horas, minutos : real
inicio
escreva("Quantos segundos o Evento dura?")
leia(segundos)
horas<-segundos/3600
minutos<-(segundos%3600)/60
sec<-(segundos%3600)%60
escreva(horas,":",minutos,":",segundos)
fimalgoritmo
I always get: Error in syntax
Which syntax error and where? Which Portugol IDE is using?
– Maniero
The syntax error is linked to the code grammar, this being stated, as mentioned in the comment above, without making explicit the IDE you are using, there is no way to respond. However, every IDE (unless mistaken) has documentation in the correct form of the syntax,
– MagicHat
This question is being debated at the goal: https://pt.meta.stackoverflow.com/q/6499/132
– Victor Stafusa