Jump to content

strpth

New Members
  • Posts

    2
  • Joined

  • Last visited

strpth's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. strpth

    php c

    Im new to php and trying to write a program that checks if a given number is prime but does not belong to the fibonaci series. The program should return 1 if the numer is prime and does not belong to the fibonaic series or 0 But each time i got OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO here is the code please reply ASAP <?php $a=0; $b=1; $i; $count=0; $num=10; while(num) { $k = $a+$b; $a = $b; $b = $k; $count++; while(k) { if(k%i==0) echo 0; } if(k==i) echo 1; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.