Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By Jar

Thread: Help with nested for-loops ???

  1. #1
    Jar
    Jar is offline Member
    Join Date
    Jan 2014
    Posts
    5
    Rep Power
    0

    Default Help with nested for-loops ???

    Hi , Could you please help me figure out how to solve this problem?

    Modify your code from the previous problem to produce the following output:

    999999999888888887777777666666555554444333221
    999999999888888887777777666666555554444333221
    999999999888888887777777666666555554444333221
    999999999888888887777777666666555554444333221

    This is what i have done but its wrong idk why ?

    Java Code:
    for*(int*i*=*0;*i*<*4;*i++)*{
    ************for*(int*j*=*9;*j*>=*1;*j--)*{
    ****************for*(int*k*=*0;*k*<*4;*k++)*{
    ********************System.out.print(j);
    ****************}
    ************}
    *************
    ************System.out.println();
    ********}
    Mayur Vachchewar likes this.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,913
    Rep Power
    5

    Default Re: Help with nested for-loops ???

    Double posted --> Problem with nested for loops?

    First, for some reason your posted code has asterisks instead of spaces. You should fix that.
    Second, you didn't show the code you were supposed to modify.
    Three, you already asked this question in another thread. Don't ask again in a new thread. It's against forum rules.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. n Nested Loops
    By joyful in forum New To Java
    Replies: 6
    Last Post: 10-16-2012, 05:14 AM
  2. Nested Loops Help!
    By spendogw in forum New To Java
    Replies: 2
    Last Post: 03-16-2012, 05:20 AM
  3. Replies: 20
    Last Post: 03-22-2011, 05:02 AM
  4. nested for loops
    By Implode in forum New To Java
    Replies: 4
    Last Post: 09-01-2009, 09:47 AM
  5. Nested Loops
    By ks1615 in forum New To Java
    Replies: 4
    Last Post: 02-18-2009, 03:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •