What is the code in C++ program that will convert money? / currency
this code has an error:
Please help me to run this program.
double dollar,pesos;
int rate;
pesos = 0;
cout<<"\n\n\nEnter the amount of dollar:";
cin >> dollar;
cout<<"\n\n\nEnter the exchange rate:";
cin >> rate;
cout.setf(ios::fixed);
cout.precision(20);
pesos + dollar * rate;
cout << dollar << "The equivalent of dollar is " << pesos << " Php" <<endl;
pesos + dollar * rate; doesn't look right if want to assign to pesos then is should be pesos = dollar * rate;
You also need to declare pesos and dollar same way as you have rate, only you may want to make them float instead of int. ints don't hold values with decimal places.