Privacy Policy Terms Of Use. Copyright © 2006-2010 Java Tutorials and Examples.
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
(2 votes)
- /*
- Write a program to generate following pattern using for loop and
- if statement.
- 1
- 22
- 333
- 4444
- 55555
- 6666
- 777
- 88
- 9
- */
- public class iffor{
- public static void main(String args[]){
- for (int x=1; x<=9; x++){
- if(x<=5){
- for(int y=1; y<=x; y++){

