SHARE
TWEET

for roen thx

a guest Feb 5th, 2018 777 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Project #2
  2.  EGRE245 Spring 2018
  3.  Christopher Aviles */
  4.  
  5. #include <stdio.h>
  6. #include <math.h>
  7.  
  8. int main(void) {
  9.     printf("Proj. #2, Christopher Aviles \n\n");
  10.     float amnt, valEnt;
  11.     int money;
  12.     printf("Amount? ");
  13.     scanf("%f",&amnt);
  14.     valEnt = amnt;
  15.     printf("value entered: %f\n\n", valEnt);
  16.     printf("$%f = \n", valEnt);
  17.     money = amnt / 20;
  18.     printf("  %d twenty dollar bill(s)\n", money);
  19.     amnt = amnt - (money * 20);
  20.     money = amnt / 10;
  21.     printf("  %d ten dollar bill(s)\n", money);
  22.     amnt = amnt - (money * 10);
  23.     money = amnt / 5;
  24.     printf("  %d five dollar bill(s)\n", money);
  25.     amnt = amnt - (money * 5);
  26.     money = amnt / 1;
  27.     printf("  %d one dollar bill(s)\n", money);
  28.     amnt = amnt - (money * 1);
  29.     money = amnt / .25;
  30.     printf("  %d quarter(s)\n", money);
  31.     amnt = amnt - (money * .25);
  32.     money = amnt / .10;
  33.     printf("  %d dime(s)\n", money);
  34.     amnt = amnt - (money * .10);
  35.     money = amnt / .05;
  36.     printf("  %d nickel(s)\n", money);
  37.     amnt = amnt - (money * .05);
  38.     money = amnt / .01;
  39.     printf("  %d pennies \n", money);
  40.     money = amnt - (money * .01);
  41.    
  42.    
  43.     return 0;
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top