I am solving this question http://www.spoj.com/problems/NEXTODD/
In this question You have to solve it in minimum number of bytes.
My code :- {print$1%2?$1+2:$1+1} which is 21 bytes.
Best solution is in 10 bytes.
Is there any other way to print $0 without using print or printf statement which can help me to reduce my code.
In the pattern/action language of AWK, there is an implicit action of printing of $0 when the pattern evaluates to true, but there is no explicit action described. Regarding your challenge, see this example (13 characters):
Hat tip to ‘some guy’, who was quicker on the draw to post the code than me.