The usual way of computing a maximum is to keep a current maximum (for instance initialized to zero), and, whenever you encounter a value which is larger than the current maximum, adjust the current maximum.
In reply to Re: counting inside the loop
by rovf
in thread counting inside the loop
by sarvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |