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 ?    430 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 ?    104 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 c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

1 Answers  


Cau u say the output....?

1 Answers  


void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }

4 Answers  


abcdedcba abc cba ab ba a a

2 Answers  


main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }

29 Answers   IBM, TCS, Wipro, UGC NET,






#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

0 Answers   RoboSoft,


how to test pierrot divisor

0 Answers  


main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }

1 Answers  


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

0 Answers  


Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.

2 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  






Categories