C++ program

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;
pesos + dollar * rate;
cout << dollar << "The equivalent of dollar is " << pesos << " Php" <<endl;
Last edited on
This is the entire source code?
If so please read http://www.cplusplus.com/doc/tutorial/

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.
I had already solve it right. Thanks anyway I appreciate your help.
Topic archived. No new replies allowed.