/*
1.	Write a C++ program with the following features:
.	It has the following menu
Enter 1 to convert from Fahrenheit to Celsius.
Enter 2 to convert from Celsius to Fahrenheit.
        			Your choice is: 
.	After the menu is displayed, the user enters his/her choice. If 
the user enters a character different than 1 or 2, then the program does 
not do anything. 
.	If the user enters 1, then the program displays:
Enter a Fahrenheit temperature to convert to Celsius: 
.	Then the user enters a Fahrenheit temperature and the program 
displays the corresponding Celsius temperature.
.	If the user enters 2, then the program displays:
Enter a Celsius temperature to convert to Fahrenheit: 
.	Then the user enters a Celsius temperature and the program 
displays the corresponding Fahrenheit temperature.
*/

#include <iostream>
using namespace std;
int main()
{
	int n;
	float F, C;
	cout << '\t' << " Enter 1 to convert from F to C.\n";
	cout << "\t Enter 2 to convert from C to F.\n";
	cout << "\t\t Your choice is: ";
	cin >> n;
	if (n == 1)
	{
		cout << "Enter a Fah. value to convert to Cel.: ";
		cin >> F;
		C = (5.0/9) * (F - 32);
		cout << "The corresponding Cel. temp. is: " << C << endl;
	}
	else if (n == 2)
	{
		cout << "Enter a Cel. value to convert to Fah.: ";
		cin >> C;
		F = (9.0/5) * C + 32;
		cout << "The corresponding Fah. temp. is: " << F << endl;
	}
	else
		cout << "Invalid Choice.\n";
	return 0;
}
