09-for.java 258 B

12345678910111213141516
  1. class Main {
  2. public static void main(String[] args) {
  3. int suma = 0;
  4. for (int i = 0; i <= 10; i++) {
  5. if (i % 2 == 0) {
  6. suma += i;
  7. System.out.println("i = " + i);
  8. }
  9. }
  10. System.out.println("Suma = " + suma);
  11. }
  12. }