/* * This one has really convoluted logic. */ #include int main () { int n ; int stop ; int matched ; stop = 0 ; printf ("Enter a positive number (type 'quit' to end): ") ; matched = scanf ("%d", &n) ; while (!stop) { if (matched <= 0 || n == 0 || n < 0) { stop = 1 ; printf ("No positive number was entered.\n") ; } else while (n > 0) { printf ("*") ; n = n - 1 ; if (n == 0) { printf ("\n") ; printf ("Enter positive number (type 'quit' to end): ") ; matched = scanf ("%d", &n) ; } } } return 0 ; }