Store exchange rate in an array, that makes the code neat: (The following is good enough as a simple example. In real life you obviously need to validate the input etc.)
Code:
#include <iostream.h>
#include <conio.h>
int main()
{
enum Currency {Rupee, Euro, Dollar};
float rate[3][3];
rate[Rupee][Rupee] = 1.;
rate[Rupee][Euro] = 2.;
rate[Rupee][Dollar] = 4.;
rate[Euro][Rupee] = 0.5;
rate[Euro][Euro] = 1.;
rate[Euro][Dollar] = 2.;
rate[Dollar][Rupee] = 0.25;
rate[Dollar][Euro] = 0.5;
rate[Dollar][Dollar] = 1.;
int from, to;
float amount;
char quit;
while (1) {
cout<<"0 - Rupee\n";
cout<<"1 - Euro\n";
cout<<"2 - Dollar\n";
cout<<"Please select the correny that you want to convert:";
cin>>from;
cout<<"Please enter the amount:";
cin >>amount;
cout<<"Please select the correny that you want to convert into:";
cin>>to;
cout << "Current exchange rate is: " << rate[from][to] << "\n";
cout << "Converted amount: " << amount * rate[from][to] << "\n";
cout << "Quit? (y/n) ";
cin >> quit;
if (quit == 'y') return 0;
}
}