#include <stdio.h>
int main()
{
// 6. Write a program to compute Fahrenheit from centigrade (f=1.8*c +32)
printf("\tTemprature Converter");
printf("\n===========================================");
float tampf, tampc;
printf("\n\nEnter The Tamprature In Celsius : ");
scanf("%f", &tampc);
tampf = 1.8 * tampc + 32;
printf("\n___________________________________________");
printf("\n\n%.2f Degree Celsius In Fahrenheit : %.2f", tampc, tampf);
printf("\n\nFormula used (f=1.8*c +32)");
printf("\n___________________________________________\n\n");
return 0;
}
f = 1.8 * c + 32
.scanf()
function.tampf
. The program then prints the converted temperature to the console using printf()
.