answersLogoWhite

0

You can do this with a nested loop:

public static void main(String[] args){

for(int i=5, i>0, i--){

for(int j=i, j>0; j--)

System.out.print(i);

System.out.print(' ');

}

}

The outer loop decrements the integer that you are printing and the inner loop will print the integer the number of times equal to its value.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How do you write 55555 4444 333 22 1 in php?

This is one of possible solutions:


What is the sequence of 122333444455555?

Each digit is repeated the number of times equal to its value. 1 22 333 4444 55555 666666 7777777 88888888 999999999


1 22 333 4444 55555 i need a java program that generates a triangle with these numbers?

Implement this method: public static void makeTriangle(int limit) { int count = 0; for(int i = 1; i <= limit; i++) { count = i; while(count > 0) { System.out.print(i); count--; } System.out.println(); } }


What is 4444 divided by 333 equals?

13.3453


Write a c program to print the following output using for loop 1 2 2 333 4444 55555?

int main() { int i,j,sum,k; for(i=1;i<=5;i++) { k=1; sum =0; for(j=1;j<=i;j++) { sum = sum+(i*k); k=k*10; } cout<< sum; cout<< "\n"; } }


What is Margaret Peterson haddixs phone number?

222 333 4444


C program to print 1 12 123 1234?

#include <stdio.h> int main (void) { puts ("1 22 333 4444 55555"); return 0; }


Write a c sharp program to print 1 22 333 4444 55555 as right angle trianglr?

using System;namespace RightAngleTraingle{class Program{static void Main(string[] args){for (int x = 1; x


What does the brain teaser 4444 mean?

it means the same thing as 333 or 55555In other words, what is there about 4444 that makes it "interesting".The answer is that it is composed of the digit 4, 4 times.


Express the sum of 4444 km and 333 km using the correct number of significant digits?

4,777 km


How do you solve graham and moser number?

22^333^444^55555^666666^7777777^88888888^999999999 repeat this step 4096 times


How would you write a C program loop that outputs the values 4444 333 22 1?

int i = 4;while (i>0) { for (int n=0; n<i; ++n) { printf ("%d", i); } printf (" "); } printf ("\n");