Single function call to printf without using if statements? [closed]

 printf(" %d %s\n", donuts == 1 ? donuts : widgets, donuts == 1 ? "donuts" : "widgets");

http://www.tutorialspoint.com/ansi_c/ternary_operator_examples.htm

Leave a Comment