main.m321 chars18 lines
In the above code block, we have first initialized an array called x
. We then created a variable called sumX
to hold the cumulative sum of all elements in x
that are strictly less than 26
.
We then looped through the array using a for
loop and checked each element against the condition x(i) < 26
. If the element satisfied the condition, we added it to the sumX
variable.
Finally, we displayed the value of sumX
.
gistlibby LogSnag