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

What are pointers really good for, anyway?

0 Answers  


What is false about the following A compound statement is a.A set of simple statments b.Demarcated on either side by curly brackets c.Can be used in place of simple statement d.A C function is not a compound statement.

5 Answers   CCEM, TCS,


Function to find the given number is a power of 2 or not?

20 Answers   Motorola, nvidia,


Write a program to compare two strings without using the strcmp() function

42 Answers   Accenture, Arba Minch University,


A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above

2 Answers   Accenture,






Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL

0 Answers  


What is the difference between the = symbol and == symbol?

0 Answers  


main() { intx=2,y=6,z=6; x=y=z; printf(%d",x) }

5 Answers   Amazon, HCL, Thought Works,


marge linklist

0 Answers   HCL,


How can you find the day of the week given the date?

0 Answers  


whitch value return void main?

11 Answers  


how to print this sereis 2 4 3 6 5..........?

3 Answers  


Categories