Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void convertToDollars(float euro);
- int main()
- {
- float euroPrice1 = 1.00;
- float euroPrice2 = 5.00;
- convertToDollars(euroPrice1);
- convertToDollars(euroPrice2);
- return 0;
- }
- //sometimes your functions need extra information, like when making calculations
- //when you pass in a variable, you can use it in another function
- void convertToDollars(float euro){
- float usd = euro * 1.37;
- printf("%.2f Euros - %.2f USD\n", euro, usd);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement