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
Can we use onclick in submit button?
List the different types of print functions available in php?
Why do we use query?
Write a program to display reverse of any number?
How do you debug php?
What is symfony php?
Why do you need to filter out empty files?
What is the name of scripting engine in php?
Tell me what should we do to be able to export data into an excel file?
How should a model be structured in mvc?
Is laravel frontend or backend?
How big is nvarchar max?
What is cms php?
How to create a session? How to set a value in session? How to remove data from a session?
What are php expressions?