Write a program that reads 10 element in array enter a number and find how many times the number is repeated in the list In PHP
Example:
<title>PHP:Write a program that reads 10 element in array enter a number and find how many times the number is repeated in the list </title>
<?php
/* Write a program that reads 10 element in array enter a number and find how many times the number is repeated in the list.*/
$n=array(1,2,9,4,5,9,7,8,9,10,9);
$sv=9;
$count=0;
for($a=1;$a<=10;$a++)
{
if($n[$a]==$sv)
{
$count++;
}
}
print"Searching values is found times = ".$count."<br>";
?>
</body>
</html>
No comments:
Post a Comment