printf("%i\n", quarters, "quarters,", "%i\n", dimes, "dimes,", "%i\n", nickels,  "nickels", "%i\n", pennies, "pennies.");

I'm trying to print variables and words in one. For example, I want to be able to print "2 quarters, 2 dimes, 2 nickels, and 2 pennies. The thing is, those numbers are random and are based upon what the user puts. The error that shows is error: data argument not used by format string [-Werror,-Wformat-extra-args]. Thank you for the help!

1 Answer 1



printf("%i quarters, %i dimes, %i nickels, %i pennies.\n", 
          quarters, dimes, nickels, pennies);

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .