I have made the code for numbers but not able to get the logic for star

please help to solve this problem.

hi @Anku47
if you observe the pattern you will see the number of patterns are like
1, 3, 5, 7 starting from the second line
so the number of stars in ith line is 2*n - 1(if i starts from 0), no stars in 0th line

thanks for the help but i have solved it before but please look into this my code


i am trying to post it in doubt section but somehow i am unable to post it. this code is working fine but when i submitted it online judge and threw a message that it is wrong and i lost my 100 marks. please tell me that what is the problem with my code…why did not online judge accepted my code.

hi @Anku47 i’ll reply on your other doubt, wait

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.