#include <iostream>
usingnamespace std;
void main()
int key = 1;
do {
int from;
int to;
double value;
cout << "Temperature converter" << endl << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl << "The Program is case-sensitve" << endl << "Choose The Temperature You Want To Convert From 1.Celsius, 2 Fahrenheit, 3 kelvin" << endl;
cin >> from;
cout << "Choose the Temperature You Want To Convert To 1.Celsius,2 Fahrenheit,3 Kelvin" << endl;
cin >> to;
cout << "Choose The Value To Convert" << endl;
cin >> value;
/*from kelvin to other units rule*/
switch (from) {
case 1:
value = value + 273.15;break;
case 2:
value = (value + 459.67) * 5 / 9;break;
case 3:
break;
default: break;
}
/*from other units to kelvin rule*/
switch (to)
{
case 1:
value = value - 273.15;break;
case 2:
value = value * 9 / 5 - 459.67;break;
case 3:break;
default:break;
}
cout << "converted value is :" << value << endl;
cout << "Created by Ahmed Khalid" << endl;
} while (key);
cout << "\tPress 1 to continue press 0 to close\n" << endl;
cin >> key;
}