Can anyone please tell me what will be the java code for printing the following pattern? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can anyone please tell me what will be the java code for printing the following pattern?

1 3 5 7 9 1 3 5 7 1 3 5 1 3 1

6th Jan 2023, 5:01 PM
Nubra
Nubra - avatar
20 Answers
+ 4
class Pattern { public static void main (String[ ] args) { for(int i=5;i>=1;i--) { int n=1; for(int j=1;j<=i;j++) { System.out.print(n +" "); n=n+2; } System.out.println(); } } }
7th Jan 2023, 2:27 PM
Srinivas vedullapalli
Srinivas vedullapalli - avatar
+ 7
I respectfully disagree that is all it is. However, you have not successfully countered my point, so I will leave it there.
6th Jan 2023, 6:05 PM
Ausgrindtube
Ausgrindtube - avatar
+ 5
This is a forum for help, not for doing all of the work for others.
6th Jan 2023, 5:28 PM
Ausgrindtube
Ausgrindtube - avatar
+ 3
Ab SH I care because I really like this app. Part of the point of it is for users to learn. You didn't help, you DID it entirely. Imagine trying to learn to talk where another person does all the speaking.
6th Jan 2023, 5:37 PM
Ausgrindtube
Ausgrindtube - avatar
+ 2
Jhazel Rose Hitalia please start your own discussion thread. Include your problem, the task and your code from the code playground. Someone might be able to help you.
8th Jan 2023, 11:10 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Why do you care ? If someone help somebody else .. What is matter?
6th Jan 2023, 5:29 PM
Ab SH
+ 1
I have another idea You can learn from your way and from solved scripts.. If you do not see a lot of codes you will not learn, in my opinion. Let the users take your simple codes that takes 10 min max and enjoy 😇
6th Jan 2023, 5:42 PM
Ab SH
+ 1
I'm absolutely agree with Ab SH and i think for better understanding and learning someone need to see code example and discuss it with another member. So... I don't accept arguments above
8th Jan 2023, 5:05 PM
Sergey Samokhvalov
Sergey Samokhvalov - avatar
+ 1
Sergey Samokhvalov Various answers is a good number of comments answering other ones. You can see maybe 4 about the same thing. Yes, seeing code can be helpful as examples, but finishing the task without giving the OP a try is harmful. Remember the purpose of the app. I understand this point is already well explained.
8th Jan 2023, 5:43 PM
Emerson Prado
Emerson Prado - avatar
0
Ab SH Gojo Saturo Pls avoid giving finished code as answer, because it makes the OP to skip the most important part of learning process. Always prefer giving hints for the OP to find the solution.
7th Jan 2023, 5:47 AM
Emerson Prado
Emerson Prado - avatar
7th Jan 2023, 8:26 AM
五条悟 ♡
五条悟 ♡ - avatar
0
Srinivas vedullapalli Pls see my previous answer to Ab SH and Gojo Saturo , and also Ausgrindtube 's. Having the OP finishing the solution helps a lot in learning.
7th Jan 2023, 4:26 PM
Emerson Prado
Emerson Prado - avatar
0
You can do it with array like that https://code.sololearn.com/cgsn7iPqKJrn/?ref=app
8th Jan 2023, 4:07 PM
Sergey Samokhvalov
Sergey Samokhvalov - avatar
0
Sergey Samokhvalov Pls read the various answers about giving finished code
8th Jan 2023, 4:13 PM
Emerson Prado
Emerson Prado - avatar
0
Emerson Prado, what is various answers? I see that members of this topic posted code above, why i cant paste my code?
8th Jan 2023, 4:47 PM
Sergey Samokhvalov
Sergey Samokhvalov - avatar
0
now i work as programmer and if i didn't saw code examples and issues with finished code - i had never start my career
8th Jan 2023, 5:08 PM
Sergey Samokhvalov
Sergey Samokhvalov - avatar
6th Jan 2023, 5:21 PM
Ab SH
- 2
Hi
7th Jan 2023, 8:29 PM
Sylvia Okeke
Sylvia Okeke - avatar
- 2
I want to study coding How will I start in this sololearn
7th Jan 2023, 8:30 PM
Sylvia Okeke
Sylvia Okeke - avatar
- 3
Can some know how to Write a program to convert Binary codes to ASCII decimal and to Character equivalent ? In python? Please help me
8th Jan 2023, 7:07 AM
Jhazel Rose Hitalia
Jhazel Rose Hitalia - avatar