0

give me the perfect program like that output.

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
int a=15;
int b=30;
clrscr();
for(i=0;i<=a;i++)
{
for(j=0;j<=b;j++)
{
if(i==0||i==2||i==a)
{
if(i==0||i==2)
if(j==0||j==b-4||j==b)
printf("+");
else printf("-");
if(i==a)
if(j==0||j==b)
printf("+");
else printf("-");
{
if(i==1||j==14)
printf("mywindow");
if(i==1||j==28)
printf("X");
}
}
if(j==0)
if(i==1||i==3||i==4||i==5||i==6||i==7||i==8||i==9||i==10||i==11||i==12||i==13||i==14)
printf("|");
else printf(" ");
if(j==b)
if(i==1||i==3||i==4||i==5||i==6||i==7||i==8||i==9||i==10||i==11||i==12||i==13||i==14)
printf("|");
else printf(" ");
}
printf("\n");
}
getch();
}



output:

0,0                                                                 0,w-4   0,w
    +------------------------------------------------------+---+
    |                  My Window                                  | x |
2,0+------------------------------------------------------+---+
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    |                                                                            |
    +----------------------------------------------------------+
h, 0                                                                       h, w


 drawWindow(60, 25)
 using only characater, not by graphics
3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by yellowSnow
1

Why are you even posting this piece of crap as a code snippet? Code snippets are usually posted by more knowledgeable members of this forum who have something useful to share with the rest of the community. That piece of rubbish should have been posted as a normal thread and more importantly a specific question should have been asked.

Before posting a code snippet, take a look at the real good snippets that have been posted and learn from it.

Edited by yellowSnow: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.