Expand|Select|Wrap|Line Numbers
- #include<stdio.h>
- /*This line is standard input output, # is directive, include is keyword, and stdio.h is header file*/
- #include<stdlib.h>
- /*This line is standard input output, # is directive, include is keyword, and stdlib.h is standard library defininition*/
- #include<math.h>
- /*This line is standard input output, # is directive, include is keyword, and math.h is mathematical declarations*/
- main (void)
- {
- int selectionNumbers;
- int n;
- int s;
- float EUR = 10.8474; /* Amount of Mexican Peso to one US Dollar */
- float CHF = 0.985; /* Amount of Canadian Dollar to one US Dollar*/
- float GPB = 0.697; /* Amount of Chiense Yuan to one US Dollar*/
- float CAD = 1.1136; /* Amount of Australian Dollar to one US Dollar*/
- float AUD = 0.710; /* Amount of European Euro to one US Dollar*/
- float money;
- float total;
- int choice;
- while (choice != '5')
- /*These lines are data declaration and initialization*/
- printf("\n Currency Converter \n");
- printf("\n Enter the type of currency \n");
- printf("\n Please select the currecny you want to convert to USD \n");
- printf("\n Press 1 for PES \n");
- printf("\n Press 2 for CAD \n");
- printf("\n Press 3 for CHI \n");
- printf("\n Press 4 for AUS \n");
- printf("\n Press 5 for EUR \n");
- scanf("%d", &choice);
- if(choice== 0)
- printf("\n Enter the amount you want to convert to USD \n");
- scanf("%d", &total);
- switch(choice)
- {
- /*PES: Mexican Peso*/
- case 1:
- total = (choice * 10.8474);
- printf("\n The equivalant USD for %f of PES is %fn \n", &total, &choice);
- break;
- /*CAD: Canaidan Dollar*/
- case 2:
- total = (choice * 0.985);
- printf("\n The equivalent USD for %f of CAD is %fn \n", &total, &choice);
- break;
- /*CHI: Chiense Yuan*/
- case 3:
- total = (choice * 0.697);
- printf("\n The equivalent USD for %f of CHI is %fn \n", &total, &choice);
- break;
- /*Aus: Austrillian Dollar*/
- case 4:
- total = (choice * 1.1136);
- printf("\n The equivalent USD for %f of AUS is %fn \n", &total, &choice);
- break;
- /*EUR: Europen Euro*/
- case 5:
- total = (choice * 0.710);
- printf("\n The equivalent USD for %f of EUR is $fn \n", &total, &choice);
- break;
- printf("\n Thanks for using the Currency Converter Program \n");
- }/*end switch*/
- }/*end main*/