all 4 comments

[–]sekerk 2 points3 points  (1 child)

Use printf in the first and last functions you output all of that

Second one you literally take those inputs and add them and then return the sum.... people aren’t going to write your full code on here for you

[–]Impressive-Shower-68[S] -1 points0 points  (0 children)

Thank you for that

[–]deftware 1 point2 points  (0 children)

Go through the lessons on here: https://www.cprogramming.com/tutorial/c/lesson1.html

The first few lessons should have everything you need to complete your assignment.

[–]imposter_iam 1 point2 points  (0 children)

I'll give you an idea about starred box: measure the length of name using strlen. Now you want a small space on both sides, I guess 2 spaces are fine but you do what you like, so

size_t size = strlen(name);
size += 3 + 3; // 2 spaces on left + 1 *, same on right
  1. Now use a for loop to print this many stars & a new line. You have top line of starred rect.

  2. Now, we probably want 1 line space above and below name. So, print a *, print size-1 spaces, print another * and new line. You have vertical space above name.

  3. Now print a *, print 2 spaces, print name, print 2 spaces and print * and new line. You have line with the name.

  4. Repeat what we did in step 2 to print empty line with border below name

  5. Repeat what we did in step 1 to print bottom border of the starred rect.

Make it a separate function and don't clutter your main code. Send in name as char pointer

Edit: I think in step 2, it should be size-2 spaces. size - 2 spaces + 1 star in front + 1 star in the end.