Skip to content

Instantly share code, notes, and snippets.

@danker
Created November 11, 2010 05:44
Show Gist options
  • Save danker/672073 to your computer and use it in GitHub Desktop.
Save danker/672073 to your computer and use it in GitHub Desktop.
#include <stdio.h>
/*
* If you pay $4.00 for a latte that costs
* $3.10, how much change do you get?
*/
int main() {
long change = 400 - 310;
printf("change = $%ld.%02ld\n", change/100, change%100);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment