Example to Convert Celcius into Fahrenheit
In this program we gonna take two Variables - Celcius and Fahrenheit. At very first, we use scanf () function and ask the user to input the value of Celcius.
After that, We use the conversion formula of Celsius to Fahrenheit for conversion. and, at last, we print the value of Fahrenheit.
# include<stdio.h>
void main()
{
float celcius, Fahrenheit;
printf("Enter the Temperature in Celcius --> ");
scanf("%f", &celcius);
Fahrenheit = 1.8 * celcius + 32;
printf(" Celcius [%.2f] = Fahrenheit [%.2f] ", celcius, Fahrenheit );
}
No comments:
Post a Comment