Java : Problem - 07

   

Problem: -

  1. Write a program to convert fahrenheit into celsius.

Solution: -

1. Write a program to convert fahrenheit into celsius.

import java.util.*;

class Celsius {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter Temperature in Fahrenheit: ");
int fah = scan.nextInt();

int cels = ((fah -32) * 5) / 9;
System.out.println("Temperature in Celsius: " + cels);

}
}

Output: -

Mj Mausam

Post a Comment

Previous Post Next Post