Print series(3*n+2)

CODE:
https://ide.codingblocks.com/#/s/20843

PROBLEM:
https://hack.codingblocks.com/contests/c/474/190
thing is i am not able to get n output rather less than n output

see the thing is loop will terminate as soon your iterator= =n, but it’s not necessary that the % condition is satisfied for ‘n’ numbers. you need to print till there are ‘n’ numbers in the output satisfying the condition of %.

i understand but then how can we print the series for exactly 10 times??
perhaps if you can share the code since I’ve tried but I am not getting the required output

https://ide.codingblocks.com/s/33659

I have made a single change. I think this will help.

thank you @Abhishek-Vanjani-138
all test case passed!

1 Like