My code for the greedy programme works fine for all numbers so far except for 4.2 . Would really appreciate it if anyone can point out the error
:) greedy.c exists
:) greedy.c compiles
:) input of 0.41 yields output of 4
:) input of 0.01 yields output of 1
:) input of 0.15 yields output of 2
:) input of 1.6 yields output of 7
:) input of 23 yields output of 92
**:( input of 4.2 yields output of 18
   \ expected output, but not "22\n"**
:) rejects a negative input like -.1
:) rejects a non-numeric input of "foo"
:) rejects a non-numeric input of ""
#include <stdio.h>
#include <cs50.h>
int main(void)
{
   float x;
  do
 {
     printf("how much change is owed(in dollars)?:\n");
     x = GetFloat();
 }
  while (x < 0);
  x = x*100;
  int i = 0;
 while (x >= 25)
 {
    x = (x-25);
    i++;
 }
  while (x >= 10)
 {
    x = (x-10);
    i++;
 }
 while (x >= 5)
 {
    x = (x-5);
    i++;
 }
 while (x >= 1)
 {
    x = (x-1);
    i++;
 }
 printf("%d\n",i);
}
 
     
     
     
    