Temperature Converter

C Programming

C Programming Examples

#include<stdio.h>

int main() {

	/* Declaration of float type variables */
	float celsius, fahrenheit;
	printf("Convert temperature from Celsius to Fahrenheit\n");
	printf("Enter temperature in Celsius:\n");
	scanf("%f", &celsius);
	fahrenheit = (celsius * (9 / 5)) + 32;

	/* Display float value upto 2 decimal point from a variable */
	printf("Fahrenheit: %.2f degree\n", fahrenheit);
	return 0;
}


          /****** Output ******/
          

Convert temperature from Celsius to Fahrenheit

Enter temperature in Celsius:

35

Fahrenheit: 67.00 degree

Learn more about Celsius and Fahrenheit