How To Make a Box in C

Hello guys, today im gonna share a code how to make a box using the ASCII Codes in C language,

You just need to Copy and Paste it in your code editor, The program will run only using Turbo C++..

Enjoy and have fun!

#include<stdio.h>
#include<conio.h>
void box();
void main()
{
    clrscr();
    box();
    getch();
}
void box()
  {
    int i;
    textcolor(WHITE);
    gotoxy(2,2);
    cprintf("\xC9");

    for(i=1;i<=74;i++)
     cprintf("\xCD");

    gotoxy(77,2);
    cprintf("\xBB");

    gotoxy(2,3);cprintf("\xBA");gotoxy(2,4);cprintf("\xBA");gotoxy(2,5);cprintf("\xBA");gotoxy(2,6);cprintf("\xBA");
    gotoxy(2,7);cprintf("\xBA");gotoxy(2,8);cprintf("\xBA");gotoxy(2,9);cprintf("\xBA");gotoxy(2,10);cprintf("\xBA");
    gotoxy(2,11);cprintf("\xBA");gotoxy(2,12);cprintf("\xBA");gotoxy(2,13);cprintf("\xBA");gotoxy(2,14);cprintf("\xBA");
    gotoxy(2,15);cprintf("\xBA");gotoxy(2,16);cprintf("\xBA");gotoxy(2,17);cprintf("\xBA");gotoxy(2,18);cprintf("\xBA");
    gotoxy(2,19);cprintf("\xBA");gotoxy(2,20);cprintf("\xBA");gotoxy(2,21);cprintf("\xBA");gotoxy(2,22);cprintf("\xBA");
    gotoxy(2,23);cprintf("\xBA");gotoxy(2,24);cprintf("\xC8");

    gotoxy(3,24);
    for(i=1;i<=74;i++)
      cprintf("\xCD");
    gotoxy(77,18);cprintf("\xBA");gotoxy(77,19);cprintf("\xBA");gotoxy(77,20);cprintf("\xBA");gotoxy(77,21);cprintf("\xBA");
    gotoxy(77,23);cprintf("\xBA");gotoxy(77,24);cprintf("\xBC");

    gotoxy(3,22);
    for(i=1;i<=74;i++)

    gotoxy(77,22);cprintf("\xBA");gotoxy(77,3);cprintf("\xBA");gotoxy(77,4);cprintf("\xBA");gotoxy(77,5);cprintf("\xBA");
    gotoxy(77,6);cprintf("\xBA");gotoxy(77,7);cprintf("\xBA");gotoxy(77,8);cprintf("\xBA");gotoxy(77,9);cprintf("\xBA");
    gotoxy(77,10);cprintf("\xBA");gotoxy(77,11);cprintf("\xBA");gotoxy(77,12);cprintf("\xBA");gotoxy(77,13);cprintf("\xBA");
    gotoxy(77,14);cprintf("\xBA");gotoxy(77,15);cprintf("\xBA");gotoxy(77,16);cprintf("\xBA");gotoxy(77,17);cprintf("\xBA");
  }
Output:


How To Make a Box in C How To Make a Box in C Reviewed by code-dev on 6:42 PM Rating: 5

No comments:

Powered by Blogger.