HOW TO FIND ODD AND EVEN NUMBERS IN JAVA?
INPUT:-
public class example{
public static void main(String args[]){
int i;
System.out.println("odd\t\t Even");
for(i=1;i<=10;i++){
if(i%2!=0)
System.out.println(i);
else
System.out.println("\t\t" + i);
}
}
}
OUTPUT:-
0 Comments