We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
this is more compact :d
printf( "%s", n <= 9 && n >= 1 ? strings[n-1]: "Greater than 9" ); //damn sounds like python xD edit: i don't remember that C could have conditional operator in printf function O_o thought it was only possible in python :D anyways, it works and that's all that matters
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Conditional Statements in C
You are viewing a single comment's thread. Return to all comments →
this is more compact :d printf( "%s", n <= 9 && n >= 1 ? strings[n-1]: "Greater than 9" ); //damn sounds like python xD edit: i don't remember that C could have conditional operator in printf function O_o thought it was only possible in python :D anyways, it works and that's all that matters