Ferix

RSOJava#11

Dec 2nd, 2020
360
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class MyClass {
  2.     public static void main(String args[]) {
  3.         int numbers[] = {10,20,30,40,50,60,70,80};
  4.         int x = 0;
  5.         int y = 0;
  6.        
  7.         for (int i : numbers){
  8.             y = x;
  9.             x = x + i;
  10.             if(x<=100){
  11.                 System.out.println(y + " + " + i + " equals " + x);
  12.             }
  13.         }
  14.     }
  15. }
RAW Paste Data