Monday, June 18, 2012

To convert Centigrade to Fahrenheit

/* To convert Centigrade to Fahrenheit */
#include <stdio.h>

#include<conio.h>

void main()

{

float c,f;

clrscr();

/*To convert Centigrade to Fahrenheit*/

printf("Enter the temperature in centigrade:\n");

scanf("%f",&c);

f = 9.0/5.0*c+32;

printf("\n\n\t%.2f Centigrade=%.2f Fahrenheit",c,f);

getch();

}

 
OUTPUT

Enter the temperature in centigrade:

45

 

45.00 Centigrade=113.00 Fahrenheit

 
 

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.