+ 1
Please need your correction
public class Program { public static void main(String[] args) { int s=0 for(int d:x) s+=d; System .out .println ("s%d\n,"s) } }
1 Answer
+ 3
missing ';' in line 4, 7
misding '{' and '}', they are not necessary when you iterate over a single line code. Depending on your goal you need to add them after your 'For' loop header. And here are the differences in your options. Either after line 6 or line 7.
after line 6 results in one output. After line 7 results in multiple outputs.
And you iterate throuh an uninitialised object x...