Https://online.codingblocks.com/app/player/56968/content/44351/5117

I cant get the logic of the above problem.I have tried many times.Please tell me the logic.

Hi @Amit.sharma 1 is not a prime number, so it wont be counted as 1 is divisible by only 1. Same goes for 0, since it is not divisible by any number.
For every other number, it can be either prime or composite. If it is a prime number then it is divisible by itself, hence it should be counted. If it is a composite number, then you have to find its prime factorisation and search for factors < 20. If there exists such a factor, then you have to count it too.

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.