^ Thank you so much gaurav its perfect.. well I have a new problem bro our professor said "Make a nested loop, that will prints out All Even numbers in in 1-50, and when it goes to 51-100 it prints out odd numbers"
basically when its still 1<50 it will prints out 2,4,6,8..50 and when its 51-100 it prints out 51,53,55,57,59..99..

Ive tried this so far..
Code: 
public class oddeven {

    public static void main(String[] args){
    	System.out.println("Even numbers: ");
    	for(int a=1;a<=50;a++){
    		if(a%2 == 0){
    			System.out.println(a);
    		}
    	}
    	System.out.println("Odd numbers: ");
    	for(int a=51;a<=100;a++){
    		if(a%2 == 1){
    			System.out.println(a);
    		}
    	}
    }


}
but our processor says make it into a single loop now I can't do it.. please please help.
conrey Reviewed by conrey on . [JAVA} Need help in a Nested Loop Any1 can help me in java that can will have an output like these please.. 54321 4321 321 21 1 Rating: 5