#include <iostream.h>
#include <iomanip.h>
void main()
{
int dir=90;
float fah,cel;
cout << "Type 1 to convert Fah to Cel,\n 2 to convert Cel to Fah";
cin >> dir;
switch(dir) {
case '1':
cout << "Enter temp in Fah: ";
cin >> fah;
cel=(fah-32)*5/9;
cout << "In Cel that's " << cel<< endl;
break;
case '2':
cout << "Enter temp in Cel: ";
cin >> cel;
fah=cel*9/5-32;
cout << "In fah that's " << fah<< endl;
break;
default: cout << endl;
}
}
Last edited on