5 comments:

  1. $num1=$_POST["num"];
    for ($i=0;$i<=9;$i++)
    {$count=0;

    $temp=$num1;
    while($temp>=1)
    {
    if($i==$temp%10)
    {
    $count++;
    }
    $temp/=10;
    }
    echo "Occurence of $i= $count
    ";

    ReplyDelete
  2. php
    $n=$_POST['num'];
    $digit=$_POST['num1'];
    $count=0;
    while($n>=1)
    {$temp=$n%10;
    if($digit==$temp)
    $count++;
    $n=$n/10;
    }
    echo "$count";
    ?>

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. $n=$_POST['n'];
    $x=$_POST['n1'];
    $count=0;
    while($n>=1)
    {$y=$n%10;
    if($x==$y)
    $count++;
    $n=$n/10;
    }
    echo "$count";

    ReplyDelete
  5. ?php
    $nos=$_POST["num"];
    $d=$_POST["dig"];
    $count=0;
    while($nos>=1)
    {
    $a=$nos%10;
    if($d==$a)
    {$count++;
    $nos=$nos/10;}
    }
    echo"digit repeated "."$count". " times .";
    ?>

    ReplyDelete