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

main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

2 Answers   IBM,


struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }

1 Answers  


main() { printf("%d", out); } int out=100;

3 Answers  


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


Sir... please give some important coding questions asked by product companies..

0 Answers  






#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }

1 Answers  


What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;

1 Answers  


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 Answers  


main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }

1 Answers  


Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }

2 Answers  


Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  


Categories