Wednesday 18 December 2013

Questions on Number System

Q: How many prime numbers are there from 0 to 100?
A: 2, 3, 5, 7, 11, 13 ,17, 19, 23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97 (25 Prime numbers)

Q: How to find the given number is prime or not?
A: Find any number x which is greater than square root of given number, Once you found it, also find how many prime numbers are there which are less than x, Divide given number by all prime number less than x. If given number is divisible by any of that prime number, then given number is not prime, otherwise it is prime number.

No comments: