Home C Language Basic C Programs Celsius to Fahrenheit

Celsius to Fahrenheit


Write a C Program to convert Celsius to Fahrenheit.

#include<stdio.h>

int main()

{

   float C,F; // ‘C’ for Celsius,’F’ for Fahrenheit

   printf(“Enter Celsius temperature : “);

   scanf(“%f”,&C); //Reading Celsius temperature

   F=C*(9/5.0)+32; //Converting Celsius temperature to Fahrenheit by predefined formula.

   printf(“Fahrenheit temperature is : %.2f”,F);

   return 0;

}

Output:

i) Enter Celsius temperature : 97

Fahrenheit temperature is : 206.60

ii) Enter Celsius temperature : -5

Fahrenheit temperature is : 23.00

For improvement of your coding skills we give some tasks along this. If you solve this tasks and send to our email (onlineexamshubteam@gmail.com) with your details. We will display your details(like Name, City, college, photo) in our site.

Task: Write a c program to convert Kilograms to Pounds.