printf(" %d %s\n", donuts == 1 ? donuts : widgets, donuts == 1 ? "donuts" : "widgets");
http://www.tutorialspoint.com/ansi_c/ternary_operator_examples.htm
More Related Contents:
- Write a C program to swap content of memory blocks of size 32 bytes
- Writing a program without IF or :? conditional operator
- typedef struct vs struct definitions [duplicate]
- Why does scanf ask twice for input when there’s a newline at the end of the format string?
- sending blocks of 2D array in C using MPI
- Why do we need C Unions?
- Code for printf function in C [duplicate]
- How can I tell gcc not to inline a function?
- What is the use of the `inline` keyword in C?
- Password to key function compatible with OpenSSL commands?
- Macro returning the number of arguments it is given in C? [duplicate]
- The difference of int8_t, int_least8_t and int_fast8_t?
- What is a contiguous memory block?
- Determine word size of my processor
- String input to flex lexer
- Comparing unsigned char and EOF
- pow() seems to be out by one here
- Where in memory are string literals ? stack / heap? [duplicate]
- How to portably print a int64_t type in C
- why does GCC __builtin_prefetch not improve performance?
- Unspecified number of parameters in C functions – void foo()
- String.indexOf function in C
- C – function returning a pointer to a local variable
- What does … mean in an argument list in C?
- strlen not checking for NULL
- Reading newline from previous input when reading from keyboard with scanf()
- How to print exact value of the program counter in C
- How can I read a child process’s output?
- CreateDesktop() with vista and UAC on (C, windows)
- Why does combining two shifts of a uint8_t produce a different result?