Senin, 07 April 2014

Convert Fahrenheit to Celsius

,
Q. Write a C program to convert Fahrenheit to Celsius temp temperature.
or
Q. Write a C program to accept temperature in Fahrenheit  from user and convert into the Celsius.


Ans.


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


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


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

Related program:
  1. Convert Celsius to Fahrenheit

0 komentar to “Convert Fahrenheit to Celsius”

Posting Komentar

 

Computer Information Copyright © 2016-2022 -- Powered by Blogger