#include <stdio.h> int main() { float celsius, fahrenheit; /* Input temperature in Celsius from the user*/ printf( "Enter temperature in Celsius: " ); scanf( "%f" , &celsius); /* Convert Celsius to Fahrenheit*/ fahrenheit = celsius * 1.8 + 32; /* Display the temperature in Fahrenheit*/ printf( "%.2f Celsius is equal to %.2f Fahrenheit\n" , celsius, fahrenheit); return 0; }
Comments
Post a Comment