下面的代码应该打印整数值是奇数还是偶数通过switch语句和for语句
for(int i=2; i<=10; i+=2)
{
switch(i)
{
case 1:
{System.out.printf("\nNot printing odd numbers");}
case 2:
System.out.printf("\n %d is an even number.", i);
//case 3:
//case 4:
}//end switch
}//end for
Run Code Online (Sandbox Code Playgroud)