C Programming Lab Manual – 12

Write a C program to Convert Temperature Celsius to Fahrenheit.

Function Main
    Declare Real celsius
    Declare Real fahrenheit
    
    Output "Enter temperature in Celsius: "
    Input celsius
    Assign fahrenheit = (celsius * 9 / 5) + 32
    Output "Fahernheit is : " &fahrenheit
End





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

Enter temperature in Celsius: 10
Fahrenheit is : 50