Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Taschenrechner by NilsAhr</title>
- </head>
- <body>
- <h1>Der Taschenrechner</h1>
- <?PHP
- $N1 = rand(0,100);
- $N2 = rand(0,100);
- $OP = "*";
- $RS = 0;
- if($OP == "+"){
- $RS= $N1+$N2;
- echo "Die Summe ist: $N1+$N2 = $RS";
- }
- else if($OP == "-"){
- $RS= $N1-$N2;
- echo "Die Differenz ist: $N1-$N2 = $RS";
- }
- else if($OP == "*"){
- $RS= $N1 * $N2;
- echo "Das Produkt ist: = $N1*$N2 = $RS";
- }
- else if($OP == "/"){
- $RS= $N1/$N2;
- echo "Der Quotiet ist: $N1/$N2 = $RS";
- }
- else
- echo "Falscher Operator.";
- ?>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement