Calculate the cost of cement for a project
Buffer overflow
Consider what entering &quot;295.8&quot; does.
#define MAXDIGITS 5
char inp[MAXDIGITS];
printf(&quot;Please input the value of cement: &quot;);
scanf(&quot;%s&quot;, inp);

Code used the dangerous scanf(&quot;%s&quot;, inp); with no width limits.  scanf(&quot;%s&quot;, inp); being ignorant of the size of inp[], stored the 5 read characters and the appended null character.
This results in undefined behavior (UB).  Code may work as expected today and fail in strange ways tomorrow.
I recommend to only use fgets() for user input.  After reading a line of user input, it is saved as a string.  Then parse the string.
No need for such a tight buffer size.  Recommend twice the expected max width needed.
#define BUFFER_SIZE (2*MAXDIGITS + 1)
char buffer[BUFFER_SIZE];

printf(&quot;Please input the value of cement: &quot;);
fflush(stdout);  // Insure output is seen before reading

fgets(buffer, sizeof buffer, stdin);
double val = strtod(buffer, NULL);