Q. Write a C program to convert temperature Celsius to Fahrenheit.
Ans.
/*c program to convert Celsius to Fahrenheit temperature*/
#include<stdio.h>
#include<conio.h>
int main()
{
float fh,cl;
printf("Enter temperature value in Celsius: ");
scanf("%f", &cl);
/*convert formula: Fahrenheit to Celsius*/
fh = (1.8*cl) + 32;
printf("Converted Fahrenheit value: %f",fh);
getch();
return 0;
}
/************Output************/
Related programs:
Ans.
/*c program to convert Celsius to Fahrenheit temperature*/
#include<stdio.h>
#include<conio.h>
int main()
{
float fh,cl;
printf("Enter temperature value in Celsius: ");
scanf("%f", &cl);
/*convert formula: Fahrenheit to Celsius*/
fh = (1.8*cl) + 32;
printf("Converted Fahrenheit value: %f",fh);
getch();
return 0;
}
/************Output************/
Screen shot for converting temperature Celsius to Fahrenheit |
Related programs:
Comments
Post a Comment