2. Write a C program to input temperature in Centigrade and convert to Fahrenheit.
Example:
Input
Enter temperature in Celsius = 100
Output
Temperature in Fahrenheit = 212 F
Solution:
#include<stdio.h>
int main()
{
double celsius,fahrenheit;
printf("Enter temperature in Celsius = ");
scanf("%lf",&celsius);
fahrenheit = (1.8*celsius) + 32;
printf("Temperature in Fahrenheit = %0.0lf F\n",fahrenheit);
return 0;
Post a Comment
0Comments