DESCRIPTION-:This program convert the temperature from Fahrenheit to the Celsius OR vice-versa according to the user need.
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int choice;
float temp,conv;
cout<<"temperature conversion menu"<<"\n";
cout<<"1.fahrenheit to celsius"<<"\n";
cout<<"2.celsius to fahrenheit"<<"\n";
cout<<"enter ur choice(1-2)";
cin>>choice;
if(choice==1)
{
cout<<"enter temp. in fahrenheit";
cin>>temp;
conv=(temp-32)/1.8;
cout<<"temp in celsius";
cout<<conv;
}
else
{
cout<<"enter temp. in celsius";
cin>>temp;
conv=(1.8*temp)+32;
cout<<conv;
}
getch();
}
PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int choice;
float temp,conv;
cout<<"temperature conversion menu"<<"\n";
cout<<"1.fahrenheit to celsius"<<"\n";
cout<<"2.celsius to fahrenheit"<<"\n";
cout<<"enter ur choice(1-2)";
cin>>choice;
if(choice==1)
{
cout<<"enter temp. in fahrenheit";
cin>>temp;
conv=(temp-32)/1.8;
cout<<"temp in celsius";
cout<<conv;
}
else
{
cout<<"enter temp. in celsius";
cin>>temp;
conv=(1.8*temp)+32;
cout<<conv;
}
getch();
}
0 comments:
Post a Comment