This is my first time on this board, and I already like it. I have been having trouble making functions work for the last several months, and this function confuses me to no ends.
The goal of the project is to force the computer to print a digit out of asterisks, something like this:
In case you are like me, and couldn't see it at first, this is a 3. The project is supposed to build on two previously made functions, printBox, and printStars, but I do not see how it does. I will also include the program I built for those functions. It is supposed to be called printDigit. Here is the code I have so far. I think I have the call and headers correct, but do not know how I should make this function work.Code:******* * * ******* * * *******
Code:#include <stdio.h> #include <stdlib.h> void printDigit(int, int); main(void) { int a,b; printf("Input 2 numbers. The first number is the number you wish to form.\n The second number will determine the size of the digit printed."); scanf("%d %d",&a,&b); void printDigit(int a, int b); } void printDigit(int a, int b) {Any help would be appreciated, as this project was due yesterday.Code:#include <stdio.h> main() { void printBox(int length, int height); printf("A 3x5 box:\n"); printBox(5, 3); printf("\n"); printf("A 5x10 box:\n"); printBox(10, 5); return 0; system("pause"); } void printAsterisks(int n) { int i; for (i=0;i<n;i++) printf("*"); } void printBlanks(int n) { int i; for (i=0;i<n;i++) printf(" "); } void printBox(int length, int height) { void printAsterisks(int n); void printBlanks(int n); int i; if (height >= 1) printAsterisks(length); printf("\n"); for (i=1;i<height-1;i++) { if (length >= 1) printf("*"); if (length >= 2) printBlanks(length - 2); printf("*"); } printf("\n"); if (height >= 2) printAsterisks(length); printf("\n"); }


