Computer Science, asked by samarpitalds, 11 months ago

Pls give me the java program logic for this :
12345
2345
345
45
5​

Answers

Answered by gublik862
0

Answer:

for i in range (1,6):

for k in range (i,6):

print(k,end=' ')

print( )

Answered by AskewTronics
0

Java program Logic:

Explanation:

  • If the user adds the following code in the java program, then he can get the above output:

for(int i=1;i<6;i++)

 {

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

     System.out.print(j);

   System.out.println(" ");

 }

Code Explanation :

  • The above code is a logic that is written in the java language, which has two for-loop.
  • The first loop runs from 1 to 6 and the second loop runs from the i to 6.
  • The print function print the value in a single line and the println function is used to change the line.

Learn More:

  • Java : https://brainly.in/question/13792074
Similar questions