Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this prog calc's the num of Large-Small containers needed
- //Large containers gotta be filled 100% 2 be used
- //small containers can be filled up 2 48%
- #include <stdio.h>
- int bottles, large, small;
- int main(void){
- printf("Enter the amount of bottles\n");
- scanf_s("%d", &bottles);
- large = bottles / 100;
- small = (bottles % 100) / 48;
- if ((bottles % 100) % 48 > 0) {
- small++;
- }
- printf("The number of large bottles needed is %d\n", large);
- printf("The number of Small bottles needed is %d\n", small);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement