Answer Posted / mishra ashutosh
i am assuming that you want to test whether a no is prime or not.
$no=123;//lets say, u can take this value form also using $_POST or $_GET
$flag=0;
for($i=2;$i<$no;++$i){
if($no%$i==0){
$flag=1;
break;
}
}
if($flag==1)
echo "$no is not a Prime No" ;
else
echo "$no is a Prime No" ;
| Is This Answer Correct ? | 18 Yes | 1 No |
Post New Answer View All Answers
Is php secure?
What is implode() in php?
What is php glob?
What are the differences between GET and POST methods?
Who is the father or inventor of php?
What are the advantages of stored procedures in php?
How to get the directory name out of a file path name?
How to select a database?
What is needed to be able to use image function?
What is the function func_num_args() used for?
How to make horizonatl menu and vertical menu responsive
What is the delimiter syntax is PHP's default delimiter syntax
What is the use of Mbstring?
What are the features of php?
Are there regular expressions in php?