#include <stdio.h>
#define CAPACITY 5000
int
main (void)
{
double supply, pumped;
printf ("Enter the the initial supply: ");
scanf ("%lf", &supply);
while (supply > CAPACITY * 0.10)
{
printf ("\nEnter the amount delivered(+)/removed(-): ");
scanf ("%lf", &pumped);
supply = supply + pumped;
if (supply < 0.0)
supply = 0.0;
if (supply > CAPACITY)
supply = CAPACITY;
}
printf ("\nSupply below 10%% (%.2lf l remaining)\n", supply);
return (0);
}
Enter the the initial supply: 2000
Enter the amount delivered(+)/removed(-): -900
Enter the amount delivered(+)/removed(-): 1100
Enter the amount delivered(+)/removed(-): -1400
Enter the amount delivered(+)/removed(-): -200
Enter the amount delivered(+)/removed(-): -250
Supply below 10% (350.00 l remaining)