0
How to print prime numbers in php? Does anyone know the formulas/syntax ?
4 Respostas
+ 1
jung1999 , you can check whether any number is divisible by anything starting from 2 to number (infact square root of number) or not... if it is divisible, number is prime.
For example , you want to check number 6 as prime, try to divide it from 2 to 5 and as it's divisible by 2 , it's not prime..
as 7 is not divisible by 2 to 6, it's prime...
note that 1 is not prime number
0
Bit in php
//forgot to write the language
0
Ketan Lalcheta okay thxx