Varasku

Suma liczb [0,10]

Oct 25th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1.  
  2. package pętlee9;
  3.  
  4.  
  5. public class PętleE9 {
  6.  
  7. public static void main(String[] args) {
  8.  
  9. int licznik =0;
  10. int suma =0;
  11. do{
  12.  
  13. // System.out.println("Liczby " + licznik);
  14. // licznik = licznik +=1;
  15. suma+=licznik++;
  16.  
  17. }
  18. while (licznik <=10);
  19.  
  20. System.out.println("Suma liczb= " + suma);
  21.  
  22.  
  23.  
  24.  
  25. }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment