answersLogoWhite

0


Best Answer

With two nested loops. In the outer loop, a variable - we might call it "n" - would go from 5 down to 1, in the inner loop, the variable (whatever you call it) goes from 5 down to n. Write out each digit in the inner loop; in the outer loop you need to add the extra space.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

8y ago
  • int x = 1;
  • while(x <= 5)
  • { for(int i = 0; i < x ; i++)
  • { System.out.print(5-i); }
  • System.out.print(" ");
  • x++;
  • }
This answer is:
User Avatar

User Avatar

Wiki User

10y ago

Make the outer loop - the variable might be "i" - go from 1 to 5 (or a higher number, if you want to continue extending the series). The inner loop goes from 1 to "i" (or from 0 to i-1).

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you print 5 54 543 5432 54321 in java using for loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you print some message on the console without using main in java?

By using the static block


How do you construct a java program that print table with backslash?

within inverted commas using two backslashes consequently .. we will print the backslash. ex: printf("//n it will gives output");


What is java program on computers?

#!/usr/bin/perl print 'java program';


What is classes in java?

class is a blueprint which does not have its own existence but it can pass all of its feature to its child classes.


How can you print a table of 5 in java by getting values from user?

look at the print


How do you print a string 5 times in java?

For(int I = 0: I &lt; 5; i++) { System.out.println(" print this " + I ); }


What is java console?

The Java console is a display of output sent by a Java program. This is similar to the MS DOS operating system.To print to the console, a programmer will type "println(text);" or "print(text);" depending is the programmer wants to make a new line after the text(println) or not(print).


How do you print message before main in java?

You cannot do that. The main method of a java class is the point where the execution begins. You can print messages only after a main method is invoked.


How do you control PowerPoint slides using java?

You can control Powerpoint Slides using Java with Aspose.Slides for Java Library: - http://www.aspose.com/java/powerpoint-component.aspx


What are the technologies without using java?

you can use type writer to avoid using java :)


What are java applications?

Applications that are built using the Java language are termed as Java applications.


Write a program to Print pyramid of numbers using java?

hi question is here, 1 1 2 1 2 3 1 2 3 4