Skip to main content

Practice · 2 of 2

Money Formatter

CHALLENGE
Difficulty: beginner+25 XP

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.

Back to lesson: Practice: Quality Gate