Guest User

working

a guest
Jan 22nd, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3. #include <math.h>
  4.  
  5. int main(void)
  6. {  
  7.     float owed;
  8.     int cents;
  9.     do
  10.     {
  11.         printf("How much is owed?\n");
  12.         printf("$");
  13.         owed = GetFloat();
  14.     }
  15.     while(owed < 0);
  16.    
  17.     cents = (int) round(owed * 100);
  18.     printf("%i\n", cents);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment