I think you are getting it wrong. Surender, your solution says that numbers divisible by all of the first 5 prime numbers will be taken into account whereas the question says that only the numbers *not* evenly divisible by *any* of the first 5 prime numbers are to be added.
Shiv, you are making two mistakes: 1. you say n is also included but your code excludes it. 2. you are just checking if a number is not divisible by one of the 5 prime numbers. If it is not divisible by any one number, you add it to your result, whereas your language of the question suggests that it should be that numbers which are not divisible by any of the five numbers, i.e., not divisible by all the 5 numbers ( not the ones divisible by just ant one of the 5). Hope I am correct in my interpretation. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.