Guest User

Untitled

a guest
Nov 9th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. <?php
  2. echo "Scrie toate numerele de doua cifre care au diferenta dintre cifra zecilor si cifra unitatilor egala cu 3 (tema de clasa a 2-a)";
  3. for($i=10; $i<=99; $i++) {
  4.     $x = (string)$i;
  5.     $a = $x[0] - $x[1];
  6.     if ( $a == 3) {
  7.         echo "<br>\r\n ({$i}) ".$i[0]." - ".$i[1].' = '.$a;
  8.     }
  9. }
Add Comment
Please, Sign In to add comment