Advertisement
aldinokemal

Switch Statement

Sep 25th, 2022
657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | Source Code | 0 0
  1. <?php
  2.  
  3. $nilai = "A";
  4. switch ($nilai) {
  5.     case "A":
  6.         echo "Anda lulus dengan baik";
  7.         break;
  8.     case "B":
  9.     case "C":
  10.         echo "Anda lulus";
  11.         break;
  12.     case "D":
  13.         echo "Anda tidak lulus";
  14.         break;
  15.     case "E":
  16.         echo "Sepertinya anda salah jurusan";
  17.         break;
  18.     default:
  19.         echo "Nilai tidak ditemukan";
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement