Answers for "code for converting fahrenheit to celsius in java"

1

celsius to fahrenheit in java

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        // celsius -----> fahrenheit

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter temperature in degree celsius: ");
        float temperatureCelsius = scanner.nextFloat();

        float temperatureFahrenheit = (temperatureCelsius * 9/5) + 32;

        System.out.printf("\n%.2f C = %.2f F\n",temperatureCelsius, temperatureFahrenheit);
    }
}
Posted by: Guest on June-25-2021
0

convert celsius to fahrenheit java code

import java.util.Scanner;
import java.io.*;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int C = sc.nextInt();

        int F=0;

        F = (C * 9)/5 + 32;

        System.out.println(F);
    }
}
Posted by: Guest on September-20-2021

Code answers related to "code for converting fahrenheit to celsius in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language