Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Conversation Between AJAY KAMBLE and hkfrenchtoast

2 Visitor Messages

  1. thnx frnd very much
  2. Here, bro. I fixed the code for ya: (I added if (i>=2) so it wouldn't have a space in the beginning. But if you don't mind, you don't need it. If you don't need it, just add a System.out.println; right after "for(i=1; i<=5; i++)". Msg me if you have questions regarding how I fixed your code!

    public static void main(String[] args) {
    int i,j;
    for(i=1;i<=5;i++)
    {
    if (i>=2)
    {
    System.out.println();
    }
    for(j=1;j<=i;j++)
    {

    System.out.print(i);
    }
    }
    }
    }
Showing Visitor Messages 1 to 2 of 2