Why is this code not working?
@cbcao263 you are using 3 nested loops, and printing random values.
Try to break down the problem line by line how to print the required pattern.
You can use this https://ide.codingblocks.com/s/214257 code as a reference, although try to write it yourself after understanding what to do.
Mam Can you please tell me how to solve these kinda questions, like what approach to follow.
@cbcao263 in pattern questions, you should try the number of items being printed and equate it with line number i or n, like in this case, total number of lines = 5
now in each line you have to print some numbers symmertiacally.
Total number of numbers = “i” like for eg in 1st line, you are printing numbers from 1 to 1, then in next line 1 to 2 then 1 to 3 and so on. Similarly you can count the number of spaces in each row and find a relation for that as well.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.