Write a program that displays the outline of a box five characters wide and five characters tall. Use the ‘*’ character for the box outline.
here are my codes:

#include <stdio.h>
#include <stdlib.h>
int main()
{
    printf("%c\v", '*');
    printf("%c\v", '*');
    printf("%c\v", '*');
    printf("%c\v", '*');


    printf("%c\n", '*');
    printf("%c%8c\n", '*','*');
    printf("%c%8c\n", '*','*');
    printf("%c%8c\n", '*','*');


    printf("%c\v", '*');
    printf("%c\v", '*');
    printf("%c\v", '*');
    printf("%c\v", '*');
    printf("%c\v\n", '*');
    system("pause");
    return (0);
}

still it works fine, i can see the outline of the box but together with the character '*' there is an another character annoying me and i dn't know how to remove it. it resembles like the gender symbol for males.

Instead of explicitly printing every every * with another line of code, you want to use loops and if statements, etc.

Think more like this, in pseudo code:

get the height and the width of the box, from the user
for each row
   move the cursor along the width of the box
   for each column    
      if the column number is the first, or the last one, 
         print a *

      if the row number is the top or the bottom
         print every column with a *
    next column
    print newline
next row    
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.