Hey guys! I'm brand new to C and I'm having a hell of a hard time so far. I'm currently writing one of my first programs for my class and I'm completely suck. We're supposed to write a cash back program where a user enters a dollar amount up to $100 and they get their change back in twenties, tens, fives, ones, quarters, dimes, nickels, and pennies.
The amount entered has to be a double and I don't understand how I can divide a double by another double, and then take the remainder and use it for another dollar value.
Any help is MUCH appreciated! My current code is below. Thanks!
#include <stdio.h>#include <stdlib.h>
float fives = 5;
float ones = 1;
float quarter = .25;
float dime = .10;
float nickel = .05;
float penny = .01;
/*Get the total input amount*/
printf("Please enter a dollar amount up to 100: ");
twenties = (dollarEnt/(20));
printf("%.0lf twenties", twenties);
tens = (twenties/(10));
printf("%.2lf tens", tens);