Advertisement
OlegGonchar

Water

Dec 17th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3.  
  4. int main(void)
  5. {
  6.     int n;
  7.     int m;
  8.  
  9. //check the positive number of minutes
  10.  
  11.     do
  12.     {
  13.         printf("How many minutes did you take shower? \n");
  14.         n = get_int();
  15.     }
  16.     while (n < 0);
  17.  
  18. //counting bottles
  19.  
  20.     m = n * 12;
  21.     printf("%i minutes \n%i bottles of water\n", n, m);
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement