/* * print n by m rectangle of 'x' as an example of using nested loops */ #include int main(void) { int n, m; printf("enter width and height of rectangle\n"); if (scanf("%d %d", &n, &m) != 2) { printf("not numbers\n"); return 1; } /* FIXME? maybe we should check here for non-positive */ for (int i = 0; i < m; ++i) { for (int j = 0; j < n; ++j) { putchar('x'); } putchar('\n'); } return 0; }