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