SHARE
TWEET

Untitled

a guest May 22nd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. echo "<br><br>ZADANIE 2 <BR> ";
  3.  
  4.     $n = 2;
  5.    
  6.     $suma= 0;
  7.    
  8.     for($i=1; $i<=$n; $i++) {
  9.         $suma+=(2*$i);
  10.     }
  11.     echo "Suma ".$n." liczb pierwszych: ".$suma;
  12.  
  13. ?>
  14.  
  15. <?php
  16.     echo "<br><br>ZADANIE 3 <BR> ";
  17.  
  18.     $a=6;
  19.     $b=2;
  20.     $c=9;
  21.     $d=5;
  22.     $wieksza1 = 0;
  23.     $wieksza2 = 0;
  24.  
  25.     if($a>=$b){
  26.         $wieksza1 = $a;
  27.     } else{
  28.         $wieksza1 = $b;
  29.     };
  30.     if($c>=$d){
  31.         $wieksza2 = $c;
  32.     } else{
  33.         $wieksza1 = $d;
  34.     };
  35.    
  36.     if($wieksza1>$wieksza2){
  37.         echo "Największa liczba to: ".$wieksza1;
  38.     } else{
  39.         echo "Największa liczba to: ".$wieksza2;
  40.     }
  41. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top