How to Find Prime Number using PHP?

How to Expose and Route to a Resource?
How to Expose and Route to a Resource?

आज इस आर्टिकल में हम आपको How to Find Prime Number using PHP? के बारे में बताएंगे।

Problem:- How to Find Prime Number using PHP?, prime number program in php using for loop, php program to check whether a number is prime or not, prime number in php, prime number program in php using if else, prime numbers from 1 to 100 using php, factorial number program in php, print numbers from 1 to 100 in php, prime number program in php without function

Solution – Find Prime Number using PHP

<?php
$a = 11;
$b = 0;
for($i = 2; $i<$a; $i++){
	if($a%$i==0){
		$b++;
		break;
	}
}
if($b==0){
	Echo "$a is prime";
}else{
	Echo "$a is not prime";
}
?>

Problem:- How to FindPrime Number using PHP?, prime number program in php using for loop, php program to check whether a number is prime or not, prime number in php, prime number program in php using if else, prime numbers from 1 to 100 using php, factorial number program in php, print numbers from 1 to 100 in php, prime number program in php without function

Final Words

  • आज इस आर्टिकल में हमने आपको How toFind Prime Number using PHP? के बारे में बताया।
  • अगर आपको इससे जुडी कोई अन्य जानकारी चाहए है तो आप निचे कमेन्ट में कमेन्ट कर के पूछ सकते है।

इसे भी पढ़े – Creating Dynamic Variable Name – $$ Uses Using PHP

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *