Some doubt relating output


sir you have sent me an alternate code for this program but I have a different algorithm for this code everything is seem right but I cannot understand that why its not showing all the output

hello @sraj39273

u r iterating only n1 time.
so in this n1 terms some of them will be divisible by n2.
so overall ur code will print less than n1 terms.

we never know after how many iteration we will find n1 terms of the series that are not divisible n2.
thats why use while loop

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.