Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyClass {
- public static void main(String args[]) {
- int numbers[] = {10,20,30,40,50,60,70,80};
- int x = 0;
- int y = 0;
- for (int i : numbers){
- y = x;
- x = x + i;
- if(x<=100){
- System.out.println(y + " + " + i + " equals " + x);
- }
- }
- }
- }
RAW Paste Data