1 comment:

  1. $num1=$_POST["num"];
    $i=2;
    $first=0;
    $second=1;
    $count=0;
    $sum=0;
    echo "$first $second";
    while($i!=$num1)
    {
    $third=$first+$second;
    $first=$second;
    $second=$third;
    echo " $third";
    $j=2;
    $flag=0;
    while($j<$third/2)
    {
    if($third%$j==0)
    {
    $flag=1;
    break;
    }
    $j++;
    }
    if ($flag==0)
    {
    $sum+=$third;
    $count++;
    }
    $i++;
    }
    echo "Number of prime number present is= $count
    Sum of them=$sum";
    ?>

    ReplyDelete