class Main {
    public static void main(String[] args) {
      
      
      
        System.out.println("fahrenheit to celsius");
        
        float value = 22f;
        
        float celsius = (22-32)*5/9f;
      
            System.out.print("= ");
          
            System.out.print(celsius);
        
            System.out.println(" celsius");
        
        //now c to f
        
            System.out.println("celsius to fahrenheite");
            
            float fahrenheite = (22*9/5f)+32f;
            // we use f there bcoz . value like 71.6 if we didnt use we get 71.0
            
            
            System.out.println(fahrenheite);
            
        
         
        
        
        
        
        
        
        
        
        
        
        
        
        
    }
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: