'C' Program To Implement Temperature Conversion
62Aim:
To write the c program to implement the temperature conversion from
i) The fahrenheit to centigrade.
ii) centigrade to fahernheit.
Algorithm:
- Start the program.
- Declare f,c,f1,c1 as float.
- Assign c1=(5.0/9.0)*(f-32).
- Assign f1=(9.0/5.0*c)+32.
- Get the values to be converted.
- Compile and run the program.
- Stop the program.
Program:
#include<stdio.h>
#include<conio.h>
void main()
{
float f,c,f1,c1;
clrscr();
printf("\n Enter the fahrenheit value");
scanf("%f",&f);
printf("\n Enter the centigrade value");
scanf("%f",&c);
c1=(5.0/9.0)*(f-32);
f1=(9.0/5.0*c)+32;
printf("\n The fahrenheit %f to centigrade is:%6.2f",f,c1);
printf("\n The centigrade %f to fahernheit value is %6.2f",c,f1);
getch();
}
Sample Output:
Enter the fahrenheit value: 98.6.
Enter the centigrade value: 32.4.
The fahrenheit 98.6 to centigrade is: 37.00.
The centigrade 32.3 to fahernheit value is : 90.32.
PrintShare it! — Rate it: up down flag this hub
'C' Program To Implement Temperature Conversion in the News
- D.C.'s largest needle-exchange program running out of cashWashington Post29 hours ago
Despite $1 million in city AIDS funding over three years, the District's largest needle-exchange program is nearly out of cash and has at times been unable to supply clean syringes to intravenous drug users.
- Reinstate B.C. green rebates: advisory groupCBC British Columbia19 hours ago
There's a call for the B.C. government to reinstate a program that encourages energy conservation by offering homeowners up to $2,000 to retrofit their homes.
- Richardson teen excels in almost everything she does, and that includes a Nobel training programDallas Morning News56 minutes ago
Richardson teen excels in almost everything she does, and that includes a Nobel training program
- Carteret health program receives awardJacksonville Daily News23 hours ago
The Carteret County Health Department’s Child Service Coordination Program (CSCP) has received the 2009 Best Practice Award from the N.C. Child and Youth Branch.
- Legendary D.C. Sportscaster George Michael Dies at 70DCist18 hours ago
DCRTV.com is reporting that legendary sportscaster George Michael, who was well-known nationally for his syndicated program "The George Michael Sports Machine," and beloved in D.C. for his work with NBC4/WRC, has passed away at the age of 70. Michael had been battling cancer for two years. A Channel 4 reporter confirmed the news to the Washington Post this morning. The last time we saw Michael ...








