Home  >  Q&A  >  body text

I would like to ask, where is the error in my php code? ? ?

<?php

$score=rand(0,100);if($score>90){ echo "Congratulations! Your score is excellent";}else if($score>=60) ;{ echo "Not bad, your score is good";}else{ echo "Sorry! You failed";}

?>

ZXTZXT1331 days ago946

reply all(4)I'll reply

  • (农行)贷款.宁同学

    (农行)贷款.宁同学2021-02-03 12:58:09

    Isn't your writing rigorous enough? If a number is 91, does it print out as excellent or passing?

    reply
    0
  • 手机用户1576633046

    手机用户15766330462021-01-28 12:16:50

    else if ($score>=60);There is a problem with; here.

    reply
    0
  • ZXT

    ZXT2021-01-27 20:58:12

    $score=rand(0,100);
    if($score>90){
        echo"恭喜!您的成绩为优秀";
    }else if($score>=60);{
        echo"不错哟,您的成绩为良好";
    }else{
        echo "很遗憾!您不及格";
    }

    reply
    0
  • 流年

    The fourth line should be else if($score>=60) and should not be followed by;

    流年 · 2021-02-02 19:05:43
  • Cancelreply