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
Can you please explain the difference between malloc() and calloc() function?
What does sizeof return c?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What are different types of variables in c?
What is the difference between a string and an array?
What's a good way to check for "close enough" floating-point equality?
Does * p ++ increment p or what it points to?
What is return in c programming?
What are disadvantages of C language.
Why is event driven programming or procedural programming, better within specific scenario?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
What is the use of static variable in c?
What is a buffer in c?
What is #define used for in c?
When the macros gets expanded?