I have an array a=[1 2 3 4 5 6 7 8 9];
.
I want to execute a while
loop which performs some actions on the array a
until all the elements in the array a
are zero.
How should I do it?
For example:
a=[1 2 3 4 5 6 7 8 9];
while(a contains all zero elements)
do some operations on a
end
At the end of the while
loop the a
should be a=[0 0 0 0 0 0 0 0 0]
.