Temperature Converter


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:

Fahrenheit: 67.00 degree

Comments (0)

  • To add your comment please or

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.

Got It!