
FINDING FAHRENHEIT – CELSIUS IN C
Finding Fahrenheit to Celsius program in C is used to find the temperature value in Fahrenheit to Celsius. Basic formula for this code is {c=(5*(f-32))/9}.
FAHRENHEIT TO CELSIUS PROGRAM:
Q: Write a C program for converting Fahrenheit to Celsius.
//Header files
#include<stdio.h>
#include<conio.h>
void main()
{
//Program variables
float f,c;
clrscr(); //Function to clear previous function
printf("ENTER THE TEMPERATURE IN FAR::--");
scanf("%f",&f); //Getting input function
c=(5*(f-32))/9; //Formula to convert Fahrenheit to Celsius
printf("THE TEMPERATURE IN CELSIUSIS::-- %f",c);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
//Program variables
float f,c;
clrscr(); //Function to clear previous function
printf("ENTER THE TEMPERATURE IN FAR::--");
scanf("%f",&f); //Getting input function
c=(5*(f-32))/9; //Formula to convert Fahrenheit to Celsius
printf("THE TEMPERATURE IN CELSIUSIS::-- %f",c);
getch();
}
No comments:
Post a comment
Note: only a member of this blog may post a comment.