Classifying integers as "weird" or "not weird"
In addition to the things dfhwze already mentioned:


You should separate calculation and output. Even the shorter solution mentioned by dfhwze contains a repetition of the output code (System.out.println) and the output message ("Not weird"). Furthermore, thinking on to real world problems, code that only outputs something is really hard to unit-test.


Thus, do something like:

private static boolean isWeird(int n) {
   return (n % 2 != 0) || (n &gt;= 6 &amp;&amp; n &lt;= 20); // or however you want to do the calculation
}

... // and in main:
boolean weird = isWeird(n);
if (weird) {
   System.out.println("Weird");
}
else {
   System.out.println("Not Weird");
}



One missing convention: variables should start with a lowecase character: N should be renamed to n