-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemperaturas.por
47 lines (39 loc) · 977 Bytes
/
temperaturas.por
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
programa
{
funcao inicio()
{
real Temp
real Resultado
escreva("Digite a temperatura em C: ")
leia(Temp)
Resultado = c_f(Temp)
escreva("\n Celsius para Fahrenheit: ", Resultado)
Resultado = c_k(Temp)
escreva("\n celsius para Kelvin: ", Resultado)
Resultado = c_r(Temp)
escreva("\n Celsius para Rankine: ", Resultado)
}
funcao real c_f(real temperatura)
{
retorne temperatura * 1.8 + 32
}
funcao real c_k(real temperatura)
{
retorne temperatura + 273.15
}
funcao real c_r(real temperatura)
{
retorne temperatura * 1.8 + 491.67
}
}
/* $$$ Portugol Studio $$$
*
* Esta seção do arquivo guarda informações do Portugol Studio.
* Você pode apagá-la se estiver utilizando outro editor.
*
* @POSICAO-CURSOR = 31;
* @PONTOS-DE-PARADA = ;
* @SIMBOLOS-INSPECIONADOS = ;
* @FILTRO-ARVORE-TIPOS-DE-DADO = inteiro, real, logico, cadeia, caracter, vazio;
* @FILTRO-ARVORE-TIPOS-DE-SIMBOLO = variavel, vetor, matriz, funcao;
*/