3 comments:

  1. $n=$_GET["num"];
    $first=0;
    $second=1;
    $count=0;
    echo "$first ";
    echo "$second ";
    for($i=2;$i<=$n;$i++)
    {
    $third=$first+$second;
    echo "$third ";
    $first=$second;
    $second=$third;
    if($third%2!=0)
    $count++;
    }
    echo "Odd numbers in the series is $count";

    ReplyDelete
  2. php
    $n=$_POST['num'];
    $first=0;
    $second=1;
    echo"$first\t$second";
    for($i=2;$i<$n;$i++)
    {$next=$first+$second;
    $first=$second;
    $second=$next;
    echo"$next\t";
    if($next%2!=0)
    $count++;
    }
    echo"
    the number of digit is:$count";

    ReplyDelete
  3. ?php
    $nos=$_POST["num"];
    $first=0;
    $second=1;
    $third=0;
    $i=1;
    echo"$first, "." $second, ";
    while($i<=$nos)
    {
    $third=$first+$second;
    $i++;
    $first=$second;
    $second=$third;
    echo"$third,";
    }
    ?>

    ReplyDelete