0
Using functions
How can I use function to calculate the total marks of a student
1 ответ
+ 1
This information is too thin, but if you have an array of marks, and a sum variable (which equals 0), you can use the enchanted for loop and add each mark to the sum variable.
To apply this with a function you need to have an array parameter which represents the mark array and you also need to return the sum variable in the end of the function.