/* File: inch2.c Draw an inch worm, inching across the screen. This time using a for loop. */ #include #include int main() { int i, j ; for (i=0 ; i <= 10 ; i++) { printf("\033[2J"); // clear screen printf("\033[H"); // go home for (j=0 ; j <= i ; j++) { printf(" ") ; } printf("_/\\_\n") ; usleep(350000) ; printf("\033[2J"); // clear screen printf("\033[H"); // go home for (j=0 ; j <= i ; j++) { printf(" ") ; } printf("_____\n") ; usleep(350000) ; } return 0 ; }