Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cs50.h>
- #include <math.h>
- int main(void)
- {
- float owed;
- int cents;
- do
- {
- printf("How much is owed?\n");
- printf("$");
- owed = GetFloat();
- }
- while(owed < 0);
- cents = (int) round(owed * 100);
- printf("%i\n", cents);
- }
Advertisement
Add Comment
Please, Sign In to add comment