#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
void main()
{
textbackground(GREEN+BLUE);
textcolor(BLACK);
clrscr();
int a;
float b,c;
cout<<setw(50)<<“…………Menu………..”<<“\n”<<“\n”;
cout<<setw(60)<<“You can chose from the following options”<<“\n”<<“\n”;
cout<<setw(61)<<“1. To convert Degree Celcius to Fahrenheit”<<“\n”;
cout<<setw(57)<<“2. To convert Degree Celcius to Kelvin”<<“\n”;
cout<<setw(61)<<“3. To convert Fahrenheit to Degree Celcius”<<“\n”;
cout<<setw(26)<<“4. Exit”<<“\n”;
cin>>a;
switch (a)
{ case 1:
clrscr();
cout<<setw(70)<<“You have chosen To convert Degree Celcius to Fahrenheit”<<“\n”<<“\n”;
cout<<setw(55)<<“Enter temperature (in Celcius) “<<“\n”;
cin>>b;
c=1.8*b+32;
cout<<b<<” Degree Celcius = “<<c<<” Fahrenheit”;
break;
case 2:
clrscr();
cout<<setw(65)<<“You have chosen To convert Degree Celcius to Kelvin”<<“\n”;
cout<<setw(52)<<“Enter Temperature (in Celcius)”<<“\n”;
cin>>b;
c=b+273.15;
cout<<b<<” Degree Celcius = “<<c<<” Kelvin”;
break;
case 3:
clrscr();
cout<<setw(65)<<“You have chosen To convert Fahrenheit to Degree Celcius”<<“\n”;
cout<<setw(53)<<“Enter temprature (in Fahrenheit)”<<“\n”;
cin>>b;
c=(b-32)*5/9;
cout<<b<<” Fahrenheit = “<<c<<” Degree Celcius”<<“\n”;
break;
case 4:
clrscr();
break;
default:
clrscr();
cout<<“Enter correct Values”;
break;
}
getch();
}
#include<conio.h>
#include<iomanip.h>
void main()
{
textbackground(GREEN+BLUE);
textcolor(BLACK);
clrscr();
int a;
float b,c;
cout<<setw(50)<<“…………Menu………..”<<“\n”<<“\n”;
cout<<setw(60)<<“You can chose from the following options”<<“\n”<<“\n”;
cout<<setw(61)<<“1. To convert Degree Celcius to Fahrenheit”<<“\n”;
cout<<setw(57)<<“2. To convert Degree Celcius to Kelvin”<<“\n”;
cout<<setw(61)<<“3. To convert Fahrenheit to Degree Celcius”<<“\n”;
cout<<setw(26)<<“4. Exit”<<“\n”;
cin>>a;
switch (a)
{ case 1:
clrscr();
cout<<setw(70)<<“You have chosen To convert Degree Celcius to Fahrenheit”<<“\n”<<“\n”;
cout<<setw(55)<<“Enter temperature (in Celcius) “<<“\n”;
cin>>b;
c=1.8*b+32;
cout<<b<<” Degree Celcius = “<<c<<” Fahrenheit”;
break;
case 2:
clrscr();
cout<<setw(65)<<“You have chosen To convert Degree Celcius to Kelvin”<<“\n”;
cout<<setw(52)<<“Enter Temperature (in Celcius)”<<“\n”;
cin>>b;
c=b+273.15;
cout<<b<<” Degree Celcius = “<<c<<” Kelvin”;
break;
case 3:
clrscr();
cout<<setw(65)<<“You have chosen To convert Fahrenheit to Degree Celcius”<<“\n”;
cout<<setw(53)<<“Enter temprature (in Fahrenheit)”<<“\n”;
cin>>b;
c=(b-32)*5/9;
cout<<b<<” Fahrenheit = “<<c<<” Degree Celcius”<<“\n”;
break;
case 4:
clrscr();
break;
default:
clrscr();
cout<<“Enter correct Values”;
break;
}
getch();
}
No comments:
Post a Comment