Code:
#include <stdio.h>
int main(){
short int quartercount = 0;
short int dimecount = 0;
short int nickelcount = 0;
short int centcount = 0;
double money;
printf("Please insert the amount of money less than $1.00 to be converted into quarters, dimes, nickels, and cents: ");
scanf("%lg", &money);
if(money > 0.99 || money < 0){
printf("I'm sorry, the amount you entered was not between $0.00 and $1.00.");
return(0);
}
else{
centcount = money * 100;
while(centcount >= 25){
centcount = centcount - 25;
quartercount++;
}
while(centcount >= 10){
centcount = centcount - 10;
dimecount++;
}
while(centcount >= 5){
centcount = centcount - 5;
nickelcount++;
}
printf("%lg represented in the lowest amount of coins possible is: %d quarters, %d dimes, %d nickels, and %d cents.",money,quartercount,dimecount,nickelcount,centcount);
}
return(0);
}
Satisfactory? :P