/* * * This one works, but matched is being used to do too many things! */ #include int main () { int n ; int stop ; int matched ; stop= 0 ; while (!stop) { printf("Enter a positive number (type 'quit' to end):") ; matched = scanf("%d", &n) ; if (matched <= 0) { stop = 1 ; } else { while (matched <= n) { printf("*") ; matched= matched + 1 ; if(n<=0 || matched<=0) break ; } } printf("\n") ; } return 0 ; }