+ 4
Pattern printing (c, c++, java , python)
N=4 10 4 9 3 5 8 1 2 6 7 And when N=5 15 7 14 6 8 13 2 5 9 12 1 3 4 10 11
19 odpowiedzi
+ 3
Hint: you can combine more loops together. Try to find out the logic of a row.
By the way please tag your programming language.
+ 4
I would say that the first row starts from N *3
+ 3
Yes, I can. But if you want to learn that, the best way will be try to solve that yourself.
+ 3
First try to code it in any language and show your attempt with a question.
+ 3
You could save your best try code on Sololearns Playground and link here. Then we can see further.
That is the way.
+ 3
I would like to recommend you working with List<String> or similar methods which allow to replace a character or string on a position. The beginning of a solution and an idea of logic for that you can see here:
https://sololearn.com/compiler-playground/c7CQG2ignHv8/?ref=app
+ 2
Can you solve it?
+ 2
The range of second row is
N*3-1 and the next minus 2 etc.
+ 2
Saima Shamim have you got any further?
+ 1
I have tried a lot of time
+ 1
Hmm ask
+ 1
Yes I have used another logic
0
Any language
0
Can I connect with you on telegram?
0
Your username please
0
I have a certain question
0
Hy
0
for the next row....
10-(3+3) = 4 , & n = 4, [ 4-1=3]
15-(4+4) = 7 & [ n= 5, [ 5-1= 4]
Hope this give you idea....