C Program For Converting Temperature Celsius Into Fahrenheit

#include <stdio.h>
int main()
{
    float celsius, fahrenheit;
    /* Input temperature in celsius */
    printf("Enter temperature in Celsius: ");
    scanf("%f", &celsius);
    /* celsius to fahrenheit conversion formula */
    fahrenheit = (celsius * 9 / 5) + 32;
    printf("%.2f Celsius = %.2f Fahrenheit", celsius, fahrenheit);
    return 0;
}

Output

Enter temperature in Celsius: 100
100 Celsius = 212.00 Fahrenheit

Leave a Comment