Not able to solve the questions and grasp the concept of pattern questions of any type.
Pattern questions in c++
Hii, @shraddhamishra812003_b58bd74465a696b0
Welcome to coding blocks!!!
for solving such kind of pattern use the following approach
- observe the pattern carefully
- try to break the problem into different parts
- then solve each part.
Note: whenever you are learning with online lectures then first try to do questions on your own(by pausing the video) then see the solution. this will help to improve your coding.
==============================================
for this problem (Pattern Magic):
Approach
break the pattern in two halfs -> upper half and lower half
now in each half you have to print
- n-i stars
- 2*i-1 spaces
- n-i stars (but in first row there is one less star so consider that also)*
copy the above code and reverse the loop of i for Lower portion
Code:
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.