#include<stdio.h>
#include<conio.h>
void main()
{
float f,c;
char key;
clrscr();
printf("Enter F = Fahrenheit or \n C = Celsius.");
printf("Enter:-");
scanf("%c",&key);
if((key == 'C')||(key == 'c'))
{
printf("\n Enter Fahrenhit number=");
scanf("%f",&f);
c = (f-32.0)/1.8;
printf("Celsius = %f",c);
}
else if((key == 'C')||(key == 'c'))
{
printf("\n Enter Celsius number=");
scanf("%f",&c);
f = ((c*1.8)+32.0);
printf("Fahrenhit = %f",f);
}
else
{
printf("Your Input is worng Press.");
}
getch();
}
<b><u>Note:-</u></b>
Here,
f for Fahrenhit,
c for Celsius and
key for another one veriable.
fahrenheit to celsius c program, celsius to fahrenheit c program,
Write a C pogram celsius to fahrenheit and vice- versa.C program to calculate fahrenheit and celsius and vice - versa,
fahrenheit to celsius c program, celsius to fahrenheit c program,
C program, C programming language.
No comments:
Post a Comment