Tue May 29 2018
Temperature Converter
C Programming892 views
File Name: temperature-converter.c
#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
Reference:
Celsius and Fahrenheit
Author:Geekboots