• + 4 comments

    you dont need to add (n%2==0) in if(n%2==1 || ( (n%2==0) && (n>=6 && n <= 20 ) ) ) statement as it is not to checking whether the number is even. we need to check only that number is odd so (n%2==1) is important and number is in bitween 6 to 20. if this doesnot follow go to direct else statement. i ran without (n%2==0) statement and it ran perfectly.