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

Answers were Sorted based on User's Feedback



How can draw a box in cprogram without using graphics.h header file & using only one printf();..

Answer / chandan kumar r

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

output:
____________________
|____________________|

Is This Answer Correct ?    37 Yes 9 No

How can draw a box in cprogram without using graphics.h header file & using only one printf();..

Answer / c.p.senthil

Generic Box routine,
to draw with prescribed length and width

// function defintion
void drawBox(int length, int width)
{
int i, j;

for(i=0; i<length; i++)
printf("_");
printf("\n");

for(j=0; j<width-1; j++)
{
printf("|");
for(i=0; i<(length-2); i++)
printf(" ");
printf("|");
printf("\n");
}

printf("|");
for(i=0; i<length-2; i++)
printf("_");
printf("|");
}

// function call
drawBox(30, 5);

Is This Answer Correct ?    1 Yes 1 No

How can draw a box in cprogram without using graphics.h header file & using only one printf();..

Answer / jai

this is foolish question

Is This Answer Correct ?    0 Yes 2 No

How can draw a box in cprogram without using graphics.h header file & using only one printf();..

Answer / veeramalliga

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

Is This Answer Correct ?    1 Yes 8 No

Post New Answer

More C Interview Questions

Why do we use static in c?

0 Answers  


what is the function of void main()?

8 Answers  


What is the difference between void main() and int main()?

1 Answers  


I have an array of 100 elements, each of which is a random integer. I want to know which of the elements: a) are multiples of 2 b) are multiples of 2 AND 5 c) have a remainder of 3 when divided by 7

1 Answers  


1,4,8,13,21,30,36,45,54,63,73,?,?.

10 Answers   AMB, Franklin Templeton,


in linking some of os executables are linking name some of them

0 Answers   IBM,


IS Doon college of Engn.. has good faculty

1 Answers  


Explain what is the heap?

0 Answers  


write a program to remove occurrences the word from entered text?

1 Answers  


what is the difference between <stdio.h> and "stdio.h"

14 Answers   Invendis, Kanbay, Mastek, MathWorks,


What is call by value in c?

0 Answers  


What is assignment operator?

0 Answers  


Categories