how can u draw a rectangle in C

Answers were Sorted based on User's Feedback



how can u draw a rectangle in C..

Answer / ketan bhavsar

Using a rectangle(int,int,int,int)function of c graphics.

Is This Answer Correct ?    431 Yes 38 No

how can u draw a rectangle in C..

Answer / m.d.balaji

using rectangle(int,int,int,int)
<left,top,right,bottom>
it is a function in graphics.h

Is This Answer Correct ?    228 Yes 21 No

how can u draw a rectangle in C..

Answer / soumya

using include<graphic.h>

Is This Answer Correct ?    185 Yes 41 No

how can u draw a rectangle in C..

Answer / m.d.balaji

USING rectangle(int,int,int,int)
it is a function in graphics.h

Is This Answer Correct ?    135 Yes 20 No

how can u draw a rectangle in C..

Answer / sala

including graphics.h
then initialising graphics system using initgraph
and using the function rectangle(int left,int top,int
right,int bottom)

Is This Answer Correct ?    114 Yes 15 No

how can u draw a rectangle in C..

Answer / raj

/* simple.c
example 1.0
*/
#include<graphics.h>
#include<conio.h>

void main()
{
int gd=DETECT, gm;

initgraph(&gd, &gm, "c:\\turboc3\\bgi " );
rectangle(200,50,350,150);

getch();
closegraph();
}

Is This Answer Correct ?    105 Yes 13 No

how can u draw a rectangle in C..

Answer / suganya

using rectangle(int right,int top,int left,int bottom) in
graphics.h

Is This Answer Correct ?    83 Yes 21 No

how can u draw a rectangle in C..

Answer / mahendra microsoft

/* simple.c
example 1.0
*/
#include<graphics.h>
#include<conio.h>

void main()
{
int gd=DETECT, gm;

initgraph(&gd, &gm, "c:\\turboc3\\bgi " );
rectangle(200,50,350,150);

getch();
closegraph();
}

Is This Answer Correct ?    67 Yes 12 No

how can u draw a rectangle in C..

Answer / venkat

BY using #include<graphics.h>
we can draw rectangle.
The syntax is rectangle(int ,int ,int ,int)
{left,top,right,bottom}

Is This Answer Correct ?    56 Yes 7 No

how can u draw a rectangle in C..

Answer / azad

first include the graphics.h file
thus you can use the rectangle funtion give the proper
parameters and the wor is done

Is This Answer Correct ?    56 Yes 17 No

Post New Answer

More C Code Interview Questions

/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }

4 Answers  


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


main() { char not; not=!2; printf("%d",not); }

1 Answers  


main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16

4 Answers   HCL,


#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }

1 Answers  






main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }

1 Answers  


write a origram swaoing valu without 3rd variable

2 Answers  


how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!

8 Answers   GATE,


enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  


Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

13 Answers   Intel, Microsoft, TCS,


C program to print magic square of order n where n > 3 and n is odd

2 Answers   Accenture,


main() { { unsigned int bit=256; printf("%d", bit); } { unsigned int bit=512; printf("%d", bit); } } a. 256, 256 b. 512, 512 c. 256, 512 d. Compile error

1 Answers   HCL,


Categories