about summary refs log tree commit diff
path: root/usth/MATH2.3/1/coin.c
blob: d4fe339a5efeafddc224f405ead62f212a356da2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>

int main()
{
	int pennies;
	scanf("%d", &pennies);
	int quarters = pennies / 25;
	pennies %= 25;
	int dimes = pennies / 10;
	pennies %= 10;
	int nickels = pennies / 5;
	pennies %= 5;

	printf("%d quarters, %d dimes, %d nickels and %d pennies\n",
	       quarters, dimes, nickels, pennies);
	return 0;
}