2
0

add stuff of 16. Jan 26

This commit is contained in:
Schuledaniel
2026-01-16 08:15:01 +01:00
parent ec20b28fc4
commit 11a260008e
2 changed files with 29 additions and 2 deletions

26
Zweites Jahr/modulo.php Normal file
View File

@@ -0,0 +1,26 @@
<?php
$ergebnis = (int)(7/2);
echo $ergebnis."<br>";
$ergebnis = 7%3;
echo "Restwert: ".$ergebnis."<br>";
// Ist ZAhl gerade?
$zahl = 5;
if($zahl % 2 == 0)echo "$zahl is gerade.<br>";
else echo "$zahl ist ungerade.<br>";
// LEtze Zahl einer ZAhl ermitteln
$zahl = 123;
echo $zahl % 10; // In Zahl steht 3 wenn $zahl%=3
echo "<br>".$zahl."<br>";
echo (int)($zahl/10); // 123 -> 12