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

Is the following code legal? struct a { int x; struct a b; }

1 Answers  


main() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


main( ) { static int a[ ] = {0,1,2,3,4}; int *p[ ] = {a,a+1,a+2,a+3,a+4}; int **ptr = p; ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *++ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); ++*ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); }

2 Answers   Persistent,


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  






#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  


int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p

2 Answers  


Derive expression for converting RGB color parameters to HSV values

1 Answers  


void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 Answers  


How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)

4 Answers   HCL,


union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4

3 Answers   HCL,


Categories