Created
November 23, 2015 05:19
-
-
Save 6uclz1/a7bf7dc7c0cdcfd455cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
struct money { | |
int dollar; | |
int cent; | |
int rate; | |
} money; | |
int exchange(struct money); | |
int main() | |
{ | |
int c; | |
printf("d c r ? "); | |
scanf("%d %d %d",&money.dollar, &money.cent, &money.rate); | |
c = exchange(money); | |
printf("%d Yen\n", c); | |
} | |
int exchange(struct money money) | |
{ | |
return (money.dollar * money.rate) + (money.cent * money.rate / 100); ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment