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.


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

4 Visitor Messages

  1. No, I tried that way and the form is of a triangle.
  2. View Conversation
    This should add a space

     for(int i = 1; i <= 4; i++){
                for(int j = 4; j >= 1; j--){
                   if(j <= i)System.out.print(j + " ");
                   else System.out.print(" ");
  3. View Conversation
    That looks ok.
  4. So, I got the pattern right, but I was wondering if anybody else had a different approach to print out the same pattern using 2 nested for loops.

    Pattern III
    2 1
    3 2 1
    4 3 2 1

    My code was:

    for(int i = 1; i <= 4; i++){
    for(int j = 4; j >= 1; j--){
    if(j <= i)System.out.print(j);
    else System.out.print(" ");
Showing Visitor Messages 1 to 4 of 4
About wolf_fcknHaley33

Basic Information

Date of Birth
April 13, 1990 (25)
About wolf_fcknHaley33
Java Skill Level:


Total Posts
Total Posts
Posts Per Day
Visitor Messages
Total Messages
Most Recent Message
May 24th, 2012 02:34 PM
Total Thanks
Total Thanks
  • Thanked 0 Times in 0 Posts
General Information
Last Activity
May 25th, 2012 12:35 AM
Join Date
May 22nd, 2012