int[] x = new int[7] { 1, 2, 3, 4, 5, 6, 7 }; int y=0; for(var i=0;i<7;i++) y+=x[i] ; return y;