• 0

N.I.N newbie in need


Question

i'm taking a C programming class at santa monica collage and for homework he gave us these 3 assignments. the problem is that there confusing to me even though i made a little blue print of it on paper. i'm currently on the first one which is to make a program that will input integer and output the minimum number of quarters, dimes, nickels and pennies needed to make up the input amount. and then it gives me 2 samples. i don't care about the other 2 right now it's the first one that has frustrated. this is what i did so far.

#include <stdio.h>

void main (){

int q, d, n, p, z, y, x, w, amount;

printf("enter the amount for which change must be created");

q=0;

d=0;

n=0;

p=0;

z=0;

y=0;

x=0;

w=0;

amount=0;

scanf("%d",&amount);

q=amount/25;

z=amount%25;

d=z/10;

y=z%10;

n=y/5;

x=y%5;

p=y/1;

w=y%1;

}

please neowin pimp my program :cool:

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.