C Program to convert temperature from degree centigrade to Fahrenheit

Logic:

  • Input temperature in centigrade
  • use formula i.e. fahrenheit = (celsius * 9 / 5) + 32
  • Print the value of fahrenheit
				
					#include<stdio.h>
#include<conio.h>
void main()
{
float c,f;
clrscr();
printf(“enter temp in centigrade: ”); 
scanf(“%f”,&c);
f=(1.8*c)+32;
printf(“temp in Fahrenheit=%f ”,f); 
getch();
}
				
			
Output:
enter temp in centigrade: 32 
temp in Fahrenheit=89.59998

Leave a Reply