Search



Monday, 16 February 2015

Temp. Centigrade to Fahrenheit

In this program, # is a preprocessor directive ,  whereas #include<filename.h> is used
to extract the functions already created in file . float deg,fah creates float type variables
which stores temprature in degrees & fahrenite given by user .conversion formula of temprature from fahrenite to degrees is degree = (fahrenite-32)/1.8 which is stored in variable deg .  

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Program for Temperature Measurement (°C to °F).

#include<stdio.h>
#include<conio.h>
void main()
{       float deg,fah;
clrscr();
printf("\n program to convert temprature from degree centigrade to fehreneit");
printf("\n\n enter temprature in fahrenite : ");
scanf("%f",&fah);
deg = (fah-32)/1.8;
printf(" temprature in degree centigrade = %f",deg);
getch();
}



No comments:

Post a Comment

Guys if you think something is wrong or should be edit than please do comment.