DragonOsman

Untitled

Oct 9th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. // Osman Zakir
  2. // 10 / 9 / 2016
  3. // Introduction to Computer Science
  4. // Problem Set 1, water.c
  5. // Ask the user how many minutes they shower for, then print out the
  6. // equivalent number of water bottles that's worth
  7.  
  8. #include <stdio.h>
  9. #include <cs50.h>
  10.  
  11. int main(void)
  12. {
  13.     printf("minutes: ");
  14.     int minutes;
  15.     minutes = scanf("%d", &minutes);
  16.     int bottles = minutes * 192 / 16;
  17.     printf("bottles: %d\n", bottles);
  18.     return 0;
  19. }
Add Comment
Please, Sign In to add comment