Originally posted by poolboi
The logic of this is code is like this:
- The code block in while loop as long as any of the three arrays exist i.e. if the arrays are of unequal size, the loop iterates until the last element in the largest array is processed.
- The printf() statement will format the output. In this case, a ten characters' space is left between the first characters of consecutive words.
- The three parameters to be printed are the elements of the 3 arrays.
- shift() statement keeps on removing the first element from the array. If any of the arrays is emptied, the shift() fails and the space character after OR(||) will be printed.
Comment