Converter temperatura em graus Centígrados para graus Fahrenheit
Meu mundo :: PROGRAMAÇÃO
:: Algorítimos
Página 1 de 1
Converter temperatura em graus Centígrados para graus Fahrenheit
Ler uma temperatura em graus Centígrados e apresentá-‐la convertida em graus Fahrenheit. A formula de conversão é: F = (9 * C + 160) / 5, onde F é a temperatura em Fahrenheit e C é a temperatura em Centígrados.
- Código:
package atividade_rogeria;
import java.util.Scanner;
public class Q17 {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
double t_c;
double t_f ;
System.out.println("Informe a temperatura em graus Centígrados: ");
t_c = input.nextInt();
t_f = (9*t_c+160/5);
System.out.println(" A temperatura em graus Fahrenheit é " + t_f);
}
}
Meu mundo :: PROGRAMAÇÃO
:: Algorítimos
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|