very new to this and trying to learn, any help might be appreciated. Got through all the errors but not getting the output i need.
#include <stdio.h>
#include <cs50.h>
#define QUARTER 25
#define DIME 10
#define NICKLE 5
#define PENNY 1
int main(void)
{
float r = 0;
float num;
int c = 0;
//Get Change, negative check
num = get_float();
if (num < 0.00)
{
printf("Retry: ");
num = get_float();
}
else
{
r = (num * 100);
}
//Quarter minus change check
do
{
r = (r - QUARTER);
c++;
printf("Remainder: %f Count: %i\n", r, c);
}
while (QUARTER <= r);
//Dime minus change check
if (r > 0.00)
{
do
{
r = (r - DIME);
c++;
printf("Remainder: %f Count: %i\n", r, c);
}
while (DIME <= r);
}
else printf("Remainder: %f Count: %i\n", r, c);
// Nickle minus change check
if (r > 0.00)
{
do
{
r = (r - NICKLE);
c++;
printf("Remainder: %f Count: %i\n", r, c);
}
while (NICKLE <= r);
}
else printf("Remainder: %f Count: %i\n", r, c);
//Penny minus change check
if (r > 0.00)
{
do
{
r = (r - PENNY);
c++;
printf("Remainder: %f Count: %i\n", r, c);
}
while (PENNY <= r);
}
else printf("Remainder: %f Count: %i\n", r, c);
}