#include<stdio.h>
#include<conio.h>
main()
{
float fer,cent;
int a;
printf("To convert centigrade to fahtenheit type '1'\nTo convert fahtenheit to centigrade type '2': ");
scanf("%d",&a);
clrscr();
if(a==1)
{
printf("Enter temperature in centigrade:");
scanf("%f", ¢);
fer=(1.8*cent)+32;
printf("\n Fehrenheit equivalent is : %.2f", fer);
}
if(a==2)
{
printf("Enter temperature in Fehrenheit:");
scanf("%f", &fer);
cent=(fer-32)*5/9;
printf("\n Centigrade equivalent is : %.2f", cent);
}
}
No comments:
Post a Comment