Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Taschenrechner by NilsAhr</title>
  6. </head>
  7. <body>
  8. <h1>Der Taschenrechner</h1>
  9. <?PHP
  10.  
  11.  
  12. $N1 = rand(0,100);
  13. $N2 = rand(0,100);
  14. $OP = "*";
  15. $RS = 0;
  16.  
  17. if($OP == "+"){
  18. $RS= $N1+$N2;
  19. echo "Die Summe ist: $N1+$N2 = $RS";
  20. }
  21.  
  22. else if($OP == "-"){
  23. $RS= $N1-$N2;
  24. echo "Die Differenz ist: $N1-$N2 = $RS";
  25. }
  26.  
  27.  
  28. else if($OP == "*"){
  29. $RS= $N1 * $N2;
  30. echo "Das Produkt ist: = $N1*$N2 = $RS";
  31. }
  32.  
  33.  
  34. else if($OP == "/"){
  35. $RS= $N1/$N2;
  36. echo "Der Quotiet ist: $N1/$N2 = $RS";
  37. }
  38. else
  39. echo "Falscher Operator.";
  40.  
  41.  
  42. ?>
  43.  
  44.  
  45.  
  46. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement