C Language | Peso-Dollar Conversion

Saturday 8 December 2012


Most Filipinos have relatives who migrated abroad especially in the US. Most of them migrated because they married foreigners, others migrated because of petitions and there are others who migrated because of work. Being a relative living abroad, there are instances that you need to help your relatives back in your hometown and that means sending money. People receiving money from their relatives living in the other countries, especially first timers, tend to confuse the value of the money they receive. US Dollars is one of the currency holding a high currency exchange rate value in the Philippines. That means one (1) US Dollar can be converted to atleast forty (40) Php. But there are instances that the value of US Dollars change due to economic changes as well.

To prevent confusions and to help first timers understand the difference of the two currencies, I made a program that will help people convert currencies easily depending on how much the value of US Dollars are in the Philippines. This program is used with three functions namely main, display and convert. Main function will hold the main program and the other functions hold the conversion and the currency being converted. Check out the codes below.


   1:   
   2:  #include<stdio.h>
   3:  #include<conio.h>
   4:   
   5:  float convert(float pesoValue, int choice, float amount);
   6:  void display(int choice, float result);
   7:   
   8:  int main()
   9:  {
  10:      int choice;
  11:      float pesoValue, amount, result = 0.0;
  12:   
  13:          printf("USD 1 is equivalent to Php ");
  14:          scanf("%f", &pesoValue);
Related Posts Plugin for WordPress, Blogger...