What part to you not understand?
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
Those statements are used to print a newline after 10 numbers are printed in a row.
% is the modulus operator. a%10 is 0 for numbers like 10, 20, and so on. So after the 10th number, the rest of the array is printed in a newline. The same happens after printing the 20th number and so on.
Comment out those lines and see how the output changes. The values printed will be the same, but the output will be in a single line.
WolfPack
Postaholic
2,051 posts since Jun 2005
Reputation Points: 572
Solved Threads: 115
if(!(a%10))
but what is not (a%10)?
if( !( a % 10 ) ) What's the programmer trying to achieve here?
Is looking for when the result of the operation a % 10 would be 0, however 0 inside an if statement will never execute since in C, 0 is considerate FALSE. Hence the ! added inside the if() to force its execution.
With this information in hand, think about the other examples you're querying about.
Aia
Nearly a Posting Maven
2,392 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 218