954,545 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

java doubt - urgent

I am not able to code this is java.
I have to use nested loops.
The pattern I need to get is
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1

nammi_aqua
Newbie Poster
3 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

What have you tried so far, or, at least, what are your ideas as to how it could work?

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
I am not able to code this is java. I have to use nested loops. The pattern I need to get is 1 2 3 4 5 6 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1


You should have tried for this.
int end = 5;
for(int i=end; i>= 1;i--){
System.out.println();
for(int j=1;j<=i;j++){
System.out.print(j);
}
}

ranjanbaisak
Newbie Poster
4 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

it's not urgent, and it's not "a doubt". In fact that's a completely incorrect way to use the word "doubt".

Do your own homework, we're not here to help you cheat your way to a diploma so you can then steal our jobs.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You