print pattern in java
34567
45673
56734
67345
73456
Answers
Answered by
1
Answer:
public class Opg4Kap3 {
public static void main(String[] args) {
printSquare(3, 7);
}
public static void printSquare(int a, int b) {
for (int k=a ; k<=b ; k++) {
System.out.print(k);
for (int i=k+1 ; i<=b ; i++) {
System.out.print(i);
}
for (int q=a; q<k; q++) {
System.out.print(q);
}
System.out.println();
}
}
}
Similar questions