java_program 4

 Practical Name: Write a java program to calculate following Pattern

                             5
                          45
                          345
                          2345
                       12345

___________________________________________________________________________

 

public class Pattern1{

public static void main(String[] args) {

for(int i = 5; i >= 1; i --)

{

for(int j = i ; j<=5; j++)

{

System. out.print(j);

}

System.out.println();

}

 

}

}

OUTPUT :-




Post a Comment

Previous Post Next Post