Skip to main content

Practice ยท 2 of 2

Money Formatter

Implement void fmt_cents(int cents, char *out) writing <dollars>.<NN> where NN is the two-digit remainder (e.g. 1234 -> "12.34", 5 -> "0.05", -250 -> "-2.50"). Use snprintf.

Difficulty: beginner

Back to lesson: Practice: Quality Gate