I have to write a function that prints a character a number of times on one line and also several lines after. I used #define to put in 10 times and 10 lines. The following code is posted. Thanks for any help.
Code:#include <stdio.h> #include <stdlib.h> #define TIMES 10 #define LINES 10 void showChar (void); int main(void) { showChar(); system("pause"); return 0; } void showChar (void) { int count = 0; int lineCount = 1; while (lineCount <= LINES){ putchar('\n'); do putchar('$'); while (count <= TIMES); count++; lineCount++; } }



LinkBack URL
About LinkBacks



