/* * increment2.c * Purpose: print a number line. 10s place on first line, 1s on second line */ #include int main(void) { int ii,jj; // delcare 2 ints for(ii=0; ii<=60; ii++) // initilize ii=0 // if ii is less than or equal to 60 // enter block // then increment by 1 { if( !(ii%10) ) // devide ii by 10 and take the remainder // reverse the logic, so only a zero is ture // evaluate truth in if, and enter block { printf("%d", ii/10 ); // will print 0 to 6 } else { printf(" "); // print a space for every number not divisable by 10 } } // end of the for loop printf("\n"); // add a new line jj=0; // assign jj a value of 0 while (jj<=60) // if jj is less than or equal to 60, do block { printf("%d", (jj++%10) ); // Precidence: ++ before % // increment jj // calculat the modulus // print deciamal value // Result: print numbers not divisible by 10 } printf("\n"); // add a new line return 0; }