How come my code is not printing the int
called coins
?
I do not see any error while running the debugging system.
#include <cs50.h>
#include <stdio.h>
int main(void)
{ // getting the user validation
printf("please enter a amount of change \n");
int change = get_int();
int coins = 0;
if (change > 0 && change <= 0 && change != 0)
printf("Change: %i\n", change);
if (change > 0)
{
printf("Change: %i\n", change);
}
if (change < 0 )
{
printf("please enter a positve number \n");
}
if (change == 0)
{
printf("Coins: 0 \n");
}
//were it counts the amount of coins
float changef = (int)change;
float qaurter = 0.25;
float dime = 0.10;
float nickel = 0.05;
float penny = 0.01;
while (changef / qaurter)
{
coins++;
return changef - qaurter;
}
while (changef / dime)
{
coins++;
return changef - dime;
}
while (changef / nickel)
{
coins++;
return changef - nickel;
}
while (changef / penny)
{
coins++;
return changef - penny;
}
printf("Coins: %i\n",coins);
}