Let\'s say that I need to format the output of an array to display a fixed number of elements per line. How do I go about doing that using modulus operation?
Using C
This JSFiddle project could help you to understand how modulus work: http://jsfiddle.net/elazar170/7hhnagrj
The modulus function works something like this:
function modulus(x,y){ var m = Math.floor(x / y); var r = m * y; return x - r; }