Convert Celsius to Fahrenheit in C - C Program to Convert Centigrade to Fahrenheit



c program that converts centigrade to fahrenheit

Learn C - C tutorial - c program that converts centigrade to fahrenheit - C examples - C programs

C Program to Convert Centigrade to Fahrenheit

  • User have to enter the temperature in centigrade, to convert centigrade temperature to Fahrenheit temperature in C programming.

Sample Code

#include <stdio.h>
float fahrenheit;
float centigrade;
char line[50];
int main()
{
    centigrade =87;
    printf("temperature (in C): 87 ");
    fgets(line, sizeof(line), stdin);
    fahrenheit = ((9.0 / 5.0) * centigrade) + 32.0;
    printf("\n%f degrees Fahrenheit.\n", fahrenheit);
    return(0);
}

Output

Temperature (in C): 87 
188.600006 degrees Fahrenheit.


View More Quick Examples


Related Searches to Convert Celsius to Fahrenheit in C - C Program to Convert Centigrade to Fahrenheit