Mega Code Archive
Categories
/
C
/
Code Snippets
Use ternary operator in printf
#include
int main(void) { int j = 8, k = 16; printf("Max of %d and %d is: %d\n", j, k, (j>k ? j : k)); return 0; }