Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write the prime number of program?in php

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


Please Help Members By Posting Answers For Below Questions

Can we use onclick in submit button?

1028


List the different types of print functions available in php?

922


Why do we use query?

939


Write a program to display reverse of any number?

911


How do you debug php?

990


What is symfony php?

955


Why do you need to filter out empty files?

926


What is the name of scripting engine in php?

1227


Tell me what should we do to be able to export data into an excel file?

954


How should a model be structured in mvc?

931


Is laravel frontend or backend?

955


How big is nvarchar max?

1016


What is cms php?

964


How to create a session? How to set a value in session? How to remove data from a session?

976


What are php expressions?

1110