Can anyone help me code the pattern given in Description Below?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Can anyone help me code the pattern given in Description Below??

This Pattern: 1 2 3 4 5 6 7 8

5th May 2018, 11:33 AM
Purnima
Purnima - avatar
6 Answers
+ 4
First try creating a diamond shape using loop(s) and I'll tell what to do next
5th May 2018, 4:54 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 2
The easiest way is to just output the 5 lines.
5th May 2018, 3:45 PM
John Wells
John Wells - avatar
+ 2
What kind of looping? 1 to 8 or other.
5th May 2018, 3:53 PM
John Wells
John Wells - avatar
+ 2
if i is 0 or i is last print number else print space
5th May 2018, 5:05 PM
Kartikey Sahu
Kartikey Sahu - avatar
+ 1
John Wells : Well that's easy😁. .But with looping statements Is what I needed..
5th May 2018, 3:47 PM
Purnima
Purnima - avatar
0
Kartikey Sahu : I couldnt print the spaces between numbers..
5th May 2018, 5:03 PM
Purnima
Purnima - avatar