×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Vasilii Vasilev
Added: May 2, 2014 2:04 PM
Views: 9
Tags: no tags
  1.  int nums[] = {1,2,3,4,5,6,7,8,9,10};
  2.        int sum = 0;
  3.        
  4.        for (int x: nums){
  5.            System.out.println("Value is: "+ x);
  6.            sum += x;
  7.                    
  8.        }
  9.         System.out.println("Summa: " +  sum);
  10.     }