Use ternary operator in printf
#include <stdio.h> int main(void) { int x = 5, y = 10; printf("Max of %d and %d is: %d\n", x, y, (x>y ? x : y)); return 0; }