Errror in complilation

Its showing perfect result in Local ide but there is error here.
Please help with this

Hey,
your code is not logically correct

Your task to is to print n1 numbers which follow the pattern 3*i + 2
but are not multiple of n2

the logic of i<=(n1+n2) is wrong
for eg i/p is n1 = 9 n2 = 3
your code is working incorrectly

1 Like

TIPS TO :How to proceed’

  1. take i =1 which would generate i th term of the sequence

  2. take a count variable which would check if n1 elements are printed or not in the while loop check if count <= n1

  3. incremenet count only if the ith term of Sequence is not a multiple of n2

Refer to this only once u have tried by yourself

1 Like

Thank you so much , if was using the same variable i for both incrementing the series and processing the loop .Got it now

Great good luck. Happy coding

1 Like