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

Explain enumerated types.

0 Answers  


what is the difference between global variable & static variable declared out side all the function in the file.

2 Answers  


Please write the area of a RIGHT ANGLED TRIANGLE.

1 Answers  


Why is c so powerful?

0 Answers  


How do you determine a file’s attributes?

0 Answers  






What is difference between structure and union in c programming?

0 Answers  


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

0 Answers   Infosys,


Give the rules for variable declaration?

0 Answers  


Tell me what are bitwise shift operators?

0 Answers  


what is answer for perfect number????????????????

1 Answers  


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

0 Answers   Mindteck,


How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?

1 Answers  


Categories