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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are qualifiers?

817


Can the curly brackets { } be used to enclose a single line of code?

945


Explain how do you generate random numbers in c?

826


Why n++ execute faster than n+1 ?

2334


c program for searching a student details among 10 student details

1883


Calculate 1*2*3*____*n using recursive function??

1765


Give basis knowledge of web designing ...

1790


What is the g value paradox?

862


Add Two Numbers Without Using the Addition Operator

569


What is the default value of local and global variables in c?

774


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

820


How can I implement sets or arrays of bits?

822


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1700


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7786


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

840