-->

Facebook

Jasper Roberts - Blog

Thursday, February 26, 2015

Write a C Program to convert Fahrenheit temperature to Centigrade.

// C Program to convert Fahrenheit temperature to Centigrade.

#include<stdio.h>
#include<conio.h>

void main()
{
       float fah, centi;
       clrscr();

       printf("Enter the temperature in Fahrenheit:");
       scanf("%f",&fah);



       centi = 5 * (fah - 32)/9;
       printf("\n Fahrenheit Temperature = %f",fah);
       printf("\n Centigrade Temperature = %f",centi);

       getch();
}

OUTPUT:
Enter the temperature in Fahrenheit: 100.00
Fahrenheit Temperature = 100.00
Centigrade Temperature = 37.77

No comments:

Post a Comment