Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CtoF {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.print("Enter degrees in Celsius to be converted: ");
- String strC = scanner.next();
- double c = Double.parseDouble(strC);
- double f = c * 9 / 5 + 32;
- System.out.println(c + " in Fahrenheit is " + f);
- scanner.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment