Math, asked by maruthilingolu1, 1 year ago

how to find out number is prime or not in webmethod

Answers

Answered by kareena3
1
a prime number is a number which is only divisible by itself and 1 like 13 17 19 23 etc
Answered by Utk123
1
let the given no. be n
we have to divide the no. from 2 to (n-1) 
if at any time remainder = 0 then no. is not prime 
and if rem. is not equal to 0 then no. is prime
eg.
no.=7
we have to divide 7 from
 2 to 6  => 2,3,4,5,6
7/2 => rem.=1
7/3 => rem. =1 and so on
here it is clear  that  rem. is not equal to zero in any case so 7 is a prime no.


powerstarmaru: i want ansr in web methods
powerstarmaru: can u tel me list of even numbers and listof prime numbers process
kareena3: 1 is neither a prime number nor a composite. prime numbers are 2 3 5 7 11 13 17 19 23 27 31
Similar questions