write a program to get a output as 12345 in java?
plz answer and i will mark u brainliest
Answers
Answered by
0
/*
Java Pyramid 5 Example
This Java Pyramid example shows how to generate pyramid or triangle like
given below using for loop.
12345
1234
123
12
1
*/
public class JavaPyramid5 {
public static void main(String[] args) {
for(int i=5; i>0 ;i--){
for(int j=0; j < i; j++){
System.out.print(j+1);
}
System.out.println("");
}
}
}
/*
Output of the example would be
12345
1234
123
12
1
*/
Answered by
0
Answer:
sorry it's is not coming in full
Attachments:
![](https://hi-static.z-dn.net/files/d45/752421ebfda2e5314257a53a9fde0dec.jpg)
Similar questions