Fahrenheit To Celsius
previous NextExample
import java.util.Scanner;
class Raj
{
public static void main(String[] args) {
float c;
float d;
Scanner sc = new Scanner(System.in);
System.out.println("Enter temp in Fahrenheit: ");
d = sc.nextInt();
c = (float)((d-32)/1.8);
System.out.print("Temperaure in Centigrade= "+c);
}
}
Output :
Enter a number: 123 Total digit is : 3