C program to enter temperature in Celsius and convert it into Fahrenheit.
/**
* C program to convert temperature from degree celsius to fahrenheit
*/
#include <stdio.h>
main()
{
int celsius, fahrenheit;
//float celsious1,farenhite2;
/* Input temperature in celsius */
printf("Enter temperature in Celsius: ");
scanf("%d", &celsius);
/* celsius to fahrenheit conversion formula */
fahrenheit = (celsius * 9 / 5) + 32;
printf("%d Celsius = %d Fahrenheit", celsius, fahrenheit);
}
OUT PUT
Enter temperature in Celsius: 45
45 Celsius = 113 Fahrenheit
--------------------------------
------------------------
*****************************************
Related Question
➤Write a C program to enter temperature in Celsius and convert it into Fahrenheit
➤Write a C program to enter temperature in Fahrenheit and convert to Celsius
➤Write a C program to convert days into years, weeks and days.
*********************************************
0 Comments