Take the following as input. A number (N1) A number (N2) Write a function which prints first N1 terms of the series 3n + 2 which are not multiples of N2

Hey @moksh what issue are you facing in this code?

i am not getting output in ascending order

my output starts from 29 instead of 5

That’s because you are dealing with bigger number until your number reaches to zero, what you can do is store it in an array and then reverse it to get desired output :grinning: