Programming for Problem Solving

GTU Practical 6

6. Write a program to compute Fahrenheit from centigrade (f=1.8*c +32)
#include<stdio.h>  ( this applies in the given code )

#include

int main()
{
float F,C;
printf(“Enter Temperature in Celsius : ” );
scanf(“%f”,&C);
F = (C * 1.8) + 32;
printf(“\n %.2f Celsius = %.2f Fahrenheit”,C, F);
return 0;
}

OUTPUT

Enter Temperature in Celsius : 10

10.00 Celsius = 50.00 Fahrenheit

GTU STUDY