We can draw a box in cprogram by using only one printf();&
without using graphic.h header file?

Answers were Sorted based on User's Feedback



We can draw a box in cprogram by using only one printf();& without using graphic.h header file..

Answer / parmjeet kumar

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("\n______________\n|______________|");
getch();
}

output:

______________
|______________|

Is This Answer Correct ?    16 Yes 9 No

We can draw a box in cprogram by using only one printf();& without using graphic.h header file..

Answer / penchalaiahdinesh

There is another method to print a box without using
graphic.h
using Ascii values

You can see ascii values by running following program..

#include<stdio.h>
#include<conio.h>
main()
{
int i;
clrscr();
for(i=0;i<=255;i++)
printf("%d %c\t",i,i);
getch();
}

The below are the program to print a clear box
#include<stdio.h>
#include<conio.h>
main()
{
int i=218,j,k=1;
clrscr();
printf("%c",i);
x:i=196;
for(j=1;j<=10;j++)
printf("%c",i);
if(k==2)
goto y;
i=191;
printf("%c\n%c %c\n%c",i,179,179,192);
if(k==1)
{k=2;goto x;}
y:printf("%c",217);
getch();
}

Just this and reply me........

Is This Answer Correct ?    5 Yes 0 No

We can draw a box in cprogram by using only one printf();& without using graphic.h header file..

Answer / chandan kumar r

yes the code is currect

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("\n______________\n|______________|");
getch();
}

output:

______________
|______________|

Is This Answer Correct ?    4 Yes 3 No

We can draw a box in cprogram by using only one printf();& without using graphic.h header file..

Answer / mohan reddy

yes the code is currect

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("\n______________\n|______________|");
getch();
}

output:

______________
|______________|

Is This Answer Correct ?    6 Yes 7 No

Post New Answer

More C Interview Questions

Why static variable is used in c?

0 Answers  


Why can't we initialise member variable of a strucutre

1 Answers  


What are local variables c?

0 Answers  


Why is c still so popular?

0 Answers  


which one is better structure or union?(other than the space occupied )

2 Answers  


What is the difference between i++ and i+1 ?(in terms of memory)

3 Answers   HCL,


Do you know pointer in c?

0 Answers  


Write the syntax and purpose of a switch statement in C.

0 Answers   Adobe,


What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value.

11 Answers   TCS,


What is strcpy() function?

0 Answers  


write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }

1 Answers  


difference between spiral and waterfall model

1 Answers  


Categories