Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package firstStepsInCoding.MoreExercises;
- import java.util.Scanner;
- public class CelsiustoFahrenheit {
- public static void main(String[] args) {
- Scanner scanner= new Scanner(System.in);
- // 79 °C = (79 x 9/5) + 32 °F = 174,2 °F
- double celsius=Double.parseDouble(scanner.nextLine());
- double result=(celsius*9/5)+32;
- System.out.printf("%.2f",result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement