0

How to print prime numbers in php? Does anyone know the formulas/syntax ?

5th Aug 2018, 5:02 AM
Fitriana Yunita Sari
Fitriana Yunita Sari - avatar
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
5th Aug 2018, 5:28 AM
Ketan Lalcheta
Ketan Lalcheta - avatar
0
Bit in php //forgot to write the language
5th Aug 2018, 6:44 AM
Fitriana Yunita Sari
Fitriana Yunita Sari - avatar
0
Ketan Lalcheta okay thxx
5th Aug 2018, 6:45 AM
Fitriana Yunita Sari
Fitriana Yunita Sari - avatar