You are viewing a single comment's thread. Return to all comments →
Well even I added n%2==0 condition but we do not need to.
As it has been said that if n is odd it is weird and if even numbers between 6-20 are weird then it doesnt matter that the number is even or odd in 6-20 as odd numbers are already weird with the condition n%2==1.
So we can have if(n%2==1 || (n>=6 && n<=20)) for the weird condition.