Quote:
Originally Posted by aijaz View Post
hello frends ... i need sme help in developing some programs in C

2 ) program .. i want out like this .. in this program .....

1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1

Code:
public class Pattern {

	public static void main(String[] args) {
		
		System.out.println("1");
		
		for(int i=1,j;i<5;i++){
			
			for(j=1;j<=i;j++){
		
				System.out.print(j+" ");
			
			}
			
			for(;j>=1;j--){
			
				System.out.print(j+" ");
			
			}
			
			System.out.println("");
			
		}
	}
}

Last edited by shabbir; 25Feb2011 at 14:30.. Reason: Code blocks