When paying cash, this eliminates all need for pennies. 

#include <stdio.h>

void adjustCost(double *cost) {
    // Check if cost is divisible by 0.05
    if (*cost * 100.0 / 5.0 - (int)(*cost * 100.0 / 5.0) != 0) {
        // If not divisible, set remainder to 0.00 by rounding down to nearest 5 cents
        *cost = (int)(*cost * 100.0 / 5.0) * 5.0 / 100.0;
    }
}

int main() {
    double cost = 1.27; // Example cost
    printf("Cost before adjustment: $%.2f\n", cost);
    adjustCost(&cost);
    printf("Cost after adjustment: $%.2f\n", cost);
    return 0;
}
#include
#include