Jump to content

Nested Loop Help

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Kragen831

Kragen831

    Newbie

  • Members
  • Pip
  • 1 posts
Hello!! I am desperate for help to create a nested loop
the out put looks like this.
99999888887777766666555554444433333222221111100000
99999888887777766666555554444433333222221111100000
99999888887777766666555554444433333222221111100000
99999888887777766666555554444433333222221111100000
99999888887777766666555554444433333222221111100000

If anyone can help or guide me through this I'll thank you forever!!
Also this output
***** ////////// *****
**** ////////\\ ****
*** //////\\\\ ***
** ////\\\\\\ **
* //\\\\\\\\ *
\\\\\\\\\\
using a method public static void figure(int figureSize))!! ^^^^^^

#2
mnirahd

mnirahd

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 330 posts
Hi,

for


99999888887777766666555554444433333222221111100000


You can see that you have to print digits from 0-9, each digit is repeated 5 times:


  for (int i = 0;  i <= 9; i++)

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

        System.out.println(i);

  System.out.println("");


I ll leave the second part to solve it yourself using the same logic. Try it and let us know!

-Munir




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users