gmahler5th
asked on
Print Mathematical function in C
I have the following variables declared, and I need to print an expression which devides 1 by the exchange rate of the local currency. How do I properly write the mathematical expression using printf? Essentially, I'm trying to pring "1 Euro = (1/0.932543)" but using the result of the mathematical function. Thanks!
#include <studio.h>
main()
{
float Euro, Peso, Yen, Pound, Shekel;
Euro = 0.932543;
Peso = 10.9554;
Yen = 118.411;
Pound = 0.734113;
Shekel = 4.87100;
printf("1 Euro = 1.07234 USD \n");
printf("1 Peso = 1.07234 USD \n");
printf("1 Yen = 1.07234 USD \n");
printf("1 Pound = 1.07234 USD \n");
printf("1 Shekel = 1.07234 USD \n");
return 0;
}
#include <studio.h>
main()
{
float Euro, Peso, Yen, Pound, Shekel;
Euro = 0.932543;
Peso = 10.9554;
Yen = 118.411;
Pound = 0.734113;
Shekel = 4.87100;
printf("1 Euro = 1.07234 USD \n");
printf("1 Peso = 1.07234 USD \n");
printf("1 Yen = 1.07234 USD \n");
printf("1 Pound = 1.07234 USD \n");
printf("1 Shekel = 1.07234 USD \n");
return 0;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.