WAP To Print Fahrenheit To Celsius Or Celsius To Fahrenheit.
#include<iostream.h>
#include<conio.h>
Void main()
{ clrscr();
Int choice;
double temp,conv_temp;
cout<<”Temprature Conversion Menu”<<”\n”;
cout<<”1. Fahrenheit to
celsius”<<”\n”;
cout<<”2. Celsius to
Fahrenheit”<<”\n”;
cout<<”Enter choice (1-2):”;
cin>>choice;
If(choice==1)
{
cout<<”\n”<<”Enter the temperature in Fahrenheit:”;
cin>>temp;
conv_temp=(temp-32)1.8;
cout<<”The temperature in
Celsius is ”<<conv_temp<<”\n”;
}
else
{
cout<<”\n”<<”Enter temperature in celcius:”;
cin>>temp;
conv_temp==(1.8*temp)+32;
cout<<”The temperature in
fahreheit is”<<conv_temp<<”\n”;
}
getch();
}
Comments
Post a Comment