Advertisement
valve2

this prog calc's the num of Large-Small containers needed

Jan 18th, 2023 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | Source Code | 0 0
  1. // this prog calc's the num of Large-Small containers needed
  2. //Large containers gotta be filled 100% 2 be used
  3. //small containers can be filled up 2 48%
  4. #include <stdio.h>
  5. int bottles, large, small;
  6. int main(void){
  7.     printf("Enter the amount of bottles\n");
  8.     scanf_s("%d", &bottles);
  9.     large = bottles / 100;
  10.     small = (bottles % 100) / 48;
  11.     if ((bottles % 100) % 48 > 0) {
  12.         small++;
  13.     }
  14.     printf("The number of large bottles needed is %d\n", large);
  15.     printf("The number of Small bottles needed is %d\n", small);
  16.  
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement