use ternary operator in printf()