/* control.c Jeff Ondich, 26 April 2019 Part of a quick intro to C if, else, while, and for all work exactly as they do in Java. That was what the designers of Java had in mind: keep the basic syntax of the language familiar for C programmers. */ #include int main() { int k; int limit = 10; printf("Counting up:"); for (k = 0; k <= limit; k++) { printf(" %d", k); } printf("\n"); printf("Counting down:"); k = limit; while (k >= 0) { printf(" %d", k); k--; } printf("\n"); printf("Skipping odds: "); for (k = 0; k <= limit; k++) { if (k % 2 == 0) { printf(" %d", k); } else { printf(" SKIP"); } } printf("\n"); return 0; }