Java Program to calculate Fahrenheit to Celsius

Description

Input1:                                                                                                                                                                                                                                                                                                                                                                                                                Enter the Fahrenheit:
284
Output1:
The Celsius Is :140

Solution

import java.util.*;
class FaToCe
{
   public static void main(String args[])
   {
       double fahreheit,celsius;
       Scanner sc=new Scanner(System.in);
       System.out.println("Enter The Fahrenheit:");
       fahreheit=sc.nextDouble();
       celsius=(fahreheit-32)*0.5556;
       System.out.println("The Celsius Is:"+celsius);
   }
}

Explanation

Get Fahrenheit  as input (using scanner class)

Calculate Celsius  using Formula celsius=(fahreheit-32)*0.5556

print Celcius  (using system.out.println).
Ramesh P Natarajan

Author - Ramesh P Natarajan

Learner, Professor, Technology Trainer, Software Developer and Content Marketer, very much passionate in the field of Software Application Development, Machine Learning and Search Engine Optimization.

Write to: admin@decodeschool.com





Interesting Pattern Programs: for more Patterns

Input:
5
Output:
*
**
***
****
*****
****
***
**
*Solution
Input:
5
Output:
    *
   ***
  *****
 *******
*********
 *******
  *****
   ***
    *Solution
Input:
5
Output:
*        *
**      **
***    ***
****  ****
**********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********Solution
Input:
5
Output:
*       *
**     **
***   ***
**** ****
*********
**** ****
***   ***
**     **
*       *Solution
Input:
5
Output:
*********
 *******
  *****
   ***
    *
   ***
  *****
 *******
*********Solution