-
Lenguaje
Java usando Scanner
-
Descripción
Convierte grados Celsius a grados Kelvin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import java.util.Scanner;
public class GradosCelsiusAKelvin {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double grados_celsius, grados_kelvin;
System.out.print("Ingresa el valor de grados celsius: ");
grados_celsius = in.nextDouble();
in.nextLine();
grados_kelvin=grados_celsius+273.15;
System.out.println("Valor de grados kelvin: " + grados_kelvin);
}
}
public class GradosCelsiusAKelvin {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double grados_celsius, grados_kelvin;
System.out.print("Ingresa el valor de grados celsius: ");
grados_celsius = in.nextDouble();
in.nextLine();
grados_kelvin=grados_celsius+273.15;
System.out.println("Valor de grados kelvin: " + grados_kelvin);
}
}