There is an example in my book that asks to write a program that prints the number 1 to 100 using 5 columns (Have each number separated from the next by a tab).
The solution was as following:
But I can't understand the if((i%5)==0) printf("\n"); statement. Could anyone explain it for me?Code:#include "stdio.h"
int main()
{
int i;
for(i=1; i<=100; i++) {
printf("%d\t", i);
if((i%5)==0) printf("\n");
}
return 0;
}