Square with numbers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Square with numbers

help to display the following figure: 1 2 * * * * * * * * * * * * * * * * 3 4 https://code.sololearn.com/cZvwE65Tpufu/?ref=app here is my attempt

11th Jun 2021, 12:08 PM
Best of Sport
Best of Sport - avatar
3 Answers
+ 5
I will not give answer, coz it was given by AJ sir, But I can suggest you to use for loop, coz for loop is used for those iteration whom you know how much time you wanna go. For loop is easily readble in your case. Using for loop - https://code.sololearn.com/cGb85TuqCWrw/?ref=app
11th Jun 2021, 12:37 PM
Abhiyantā
Abhiyantā - avatar
+ 2
Best of Sport You can add two loop above and below the star pattern. https://code.sololearn.com/cJqo6DBe67ys/?ref=app
11th Jun 2021, 12:28 PM
AĶ¢J
AĶ¢J - avatar
0
your exact code pattern unmodified except two loops additions to add digits at corners: https://code.sololearn.com/cdcuy5ccMy9O/?ref=app
11th Jun 2021, 4:58 PM
visph
visph - avatar