Tutorials

# Convert Celsius to Fahrenheit

Celsius is a unit to measure temperature scale on which water freezes at 0 degree and boiling point is 100 degree.

Celsius is a unit to measure temperature scale on which water freezes at 0 degree and boiling point is 100 degree.

# Convert Celsius to Fahrenheit

Celsius is a unit to measure temperature scale on which water freezes at 0 degree and boiling point is 100 degree. This unit is discovered by Celsius in 1742, a Swedish astronomer and physicist, he has invented the centigrade, or Celsius thermometer divided between the freezing and boiling points of water into 100 parts.

Fahrenheit Scale was invented by Daniel Gabriel Fahrenheit , he was the German physicist who invented the temperature scale that was patented by his name Fahrenheit Scale.

In this example you will learn how to convert the temperature Celsius to Fahrenheit. To change the Celsius to Fahrenheit we have the formula Fahrenheit = 32 + 9 * c / 5. To change the Celsius to Fahrenheit we need one html page which will take any value as a Celsius and later this Celsius parameter will be get into the jsp page and the formula will be implemented on  this variable and the result will be displayed to you. All this processing will be done inside the scriptlet directive.

The code of the program is given below.

 ``` Convert Celsius to Fahrenheit Jsp ``` ```

Convert Celsius to Fahrenheit Jsp

``` `

Enter Temprature in Celsius:` ```

<% String str=request.getParameter("cel");``` ` if(str == null || str.equals("")){ ` ``` out.println("Fahrenheit:"); } else{``` ``` float c=Float.parseFloat(str); float f = 32 + 9*c/5;``` ` out.println("Fahrenheit:"+f);` ``` }%>

```

Output: 