Skip to content

Instantly share code, notes, and snippets.

@6uclz1
Created November 23, 2015 05:19
Show Gist options
  • Save 6uclz1/a7bf7dc7c0cdcfd455cd to your computer and use it in GitHub Desktop.
Save 6uclz1/a7bf7dc7c0cdcfd455cd to your computer and use it in GitHub Desktop.
#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