Write a java program to print this numeric pattern
1 2 3 4
8 7 6 5
9 10 11 12
16 15 14 13
class NumericPattern2
{
public static void main(String[] alt){
int n=4;
for(int i=0;i<n;i++){
for(int j=1;j<=n;j++){
if(i%2==0)
System.out.print(i*n+j+" ");
else
System.out.print((i+1)*n-j+1+" ");
}
System.out.println();
}
}
0 Comment to "Write a java program to print this numeric pattern 1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13 "
Post a Comment