8.01.2012

Convert Celsius to Fahrenheit

Q. Write a C program to convert temperature  Celsius to Fahrenheit.


Ans.


/*c program to convert Celsius to Fahrenheit temperature*/
#include<stdio.h>
#include<conio.h>
int main()
{
 float fh,cl;
 printf("Enter temperature value in Celsius: ");
 scanf("%f", &cl);
 /*convert formula: Fahrenheit to Celsius*/
 fh = (1.8*cl) + 32;
 printf("Converted Fahrenheit value: %f",fh);
 getch();
 return 0;
}


/************Output************/


Output of convert temperature Celsius to Fahrenheit C program
Screen shot for converting temperature
Celsius to Fahrenheit


Related programs:

  1. Convert Fahrenheit to Celsius

2 comments: