Adding an Else


#1


My program looks like this.

  <?php
    $items = 10;
    
    if($items > 5) {
      echo "You get a 10% discount!";
    }
    else {
        echo "You get a 5% discoun!";
    }
  ?>


ERROR:
Oops, try again. Did you set your else statement to echo or print 'You get a 5% discount!' ? Don't forget your semicolon at the end!



#2

discoun // check spelling

#3


no se que tengo malo con mi código si me pueden ayudar por favor


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.