#include <stdio.h> #include <stdlib.h> /* Puzzle L24 -- print a square divided into 8 horizontal bands of alternating * and . */ int main() { int row, col; int boardsize=16, bandsize=boardsize/8; for ( row=0; row<boardsize; row++ ) { for ( col=0; col<boardsize; col++ ) { if ( (row/bandsize)%2 == 0) printf("*"); else printf("."); } printf("\n"); } printf("\n"); return 0; }