Skip to main content
Skip to content

Math · Beginner

Celsius to Fahrenheit Program in Hinglish

Convert between Celsius and Fahrenheit with two small functions.

The program

Edit anything and press Run. The output below was produced by running this exact code.

Expected output

Press Run to try it

0 C = 32 F25 C = 77 F37 C = 98.6 F100 C = 212 F98.6 F = 37 C-40 C = -40 F  (dono scale yahan barabar hain!)

How it works

The formulas are F = C x 9 / 5 + 32 and C = (F - 32) x 5 / 9. Each becomes a one-line function that returns the answer.

Brackets matter in f_se_c: without them the 32 would be multiplied first. The loop converts four common temperatures, and the last line shows the one point where both scales agree: minus 40.