The first problem to tackle would be working out what parameters PrintChars should receive.

For the moment, forget about the two functions and just code in main the following.
Code:
for ( int h = 0 ; h < height ; h++ ) {
  for ( int w = 0 ; w < width ; w++ ) {
	putchar(boxChar);
  }
  putchar('\n');
}
Run it at make sure it works.

The inner loop will become your printChars function. You can see that the variables needed would be width and boxChar.

So copy the inner loop to the function, and edit your main loop to be
Code:
for ( int h = 0 ; h < height ; h++ ) {
  printChars(width, boxChar);
  putchar('\n');
}
Test again to make sure it's as it was before.


Then you repeat the same process again, moving the outer loop to PrintBox, and main just becomes a single function call.



Oh, and watch your use of = vs ==.
Code:
foo.c: In function ‘main’:

foo.c:56:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]

   56 |    else if(result = 1)

      |            ^~~~~~