divide decimals with round-off (calculate the price of cement)

PHOTO EMBED

Sat Mar 09 2024 18:51:19 GMT+0000 (Coordinated Universal Time)

Saved by @NoobAl

#include <stdio.h>
int main (void) {
    double AmountOfCement;
    int iTotalCost, NumberOfBags;
    scanf ("%lf", &AmountOfCement);
    NumberOfBags = (int) (AmountOfCement/120 + 1);
    iTotalCost = NumberOfBags * 45;
    printf ("%d", iTotalCost);
    return 0;
}
content_copyCOPY