Q. Write a C program to convert Fahrenheit to Celsius temp temperature.
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************/
Related program:
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************/
Screen shot for convert temperature from Fahrenheit to celsius |
Related program:
thnku very much....................
ReplyDeletepls give me a complexity for this program
ReplyDeleteyeaaah it wrks thncx dr
ReplyDeletethnkuuu vry much
ReplyDeleteif i want to take option lyk far or cel what i have to do i mean making if condition lyk suppose st as string and i that enter the far or cel and if far by using cel we can convert. and if st if cel by taking far i will caluculate lyk that i want
ReplyDeleteDear beloved brother I'm a new learner of C language. I understood your all codes except getch(); this statement. Would you please explain this?
ReplyDeleteWE USE GETCH() TO HOLD OUTPUT SCREEN
Deletecan i use system(pause); to hold out put screen
ReplyDeletecan i use system(pause); to hold out put screen
ReplyDelete