Q:

Write a Java Program to Convert Celsius to Fahrenheit

belongs to collection: Java Basic Solved Programs

0

Java Program to convert celsius to Fahrenheit in Java Programming, you have to ask to the user to enter the temperature in celsius to convert it into Fahrenheit to display the equivalent temperature in Fahrenheit as shown in the following program.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

SOURCE CODE ::

import java.util.Scanner;

public class CelsiusToFahrenheit
{
    public static void main(String args[])
    {
        float cen;
        double fah;
        Scanner scan = new Scanner(System.in);
                
        System.out.print("Enter Temperature in Celsius : ");
        cen = scan.nextFloat();
                
        fah = (1.8*cen) + 32;
                
        System.out.println("Temperature in Fahrenheit = " + fah);
    }
} 

OUTPUT ::

Enter Temperature in Celsius : 32
Temperature in Fahrenheit = 89.6

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Java Basic Solved Programs

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a Menu Driven Java Program for If, Switch, W... >>
<< Write a Java program to convert Fahrenheit to Cels...