Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. <?php
  2. //petla for
  3. $wynik=0;
  4. for($i=0;$i<=10;$i++){
  5. $wynik+=$i;
  6. }
  7. echo $wynik;
  8.  
  9.  
  10.  
  11. //petla while
  12. $i2=1;
  13. $wynik2=0;
  14. while($i2<=10){
  15. $wynik2+=$i2;
  16. $i2++;
  17. }
  18. echo $wynik2;
  19.  
  20.  
  21. //petla do while
  22.  
  23. $i3=1;
  24. $wynik3=0;
  25. do{
  26. $wynik3+=$i3;
  27. $i3++;
  28.  
  29. }while($i3<=10);
  30. echo $wynik3;
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement