Help me plz to fill in the blanks to calculate the sum of all elements in the array "arr" using an enhanced for loop | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Help me plz to fill in the blanks to calculate the sum of all elements in the array "arr" using an enhanced for loop

Int res = 0 ___(int el__arr) { res+=___; }

25th Jun 2019, 2:31 PM
Boy Arya
Boy Arya - avatar
1 Answer
+ 10
int res=0; for(int el:arr){ res+=el; }
25th Jun 2019, 2:44 PM
Mritunjay Kumar
Mritunjay Kumar - avatar