
write a program to print 1234 567 89 10

Hi Friend,
Try the following code:
public class PatternExample {
public static void main(String[] args) {
int y = 1;
for(int i=4; i>= 1 ;i--){
for(int j=1; j <= i ; j++){
System.out.print(y + " ");
y = y + 1;
}
System.out.println("");
}
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.