how can u draw a rectangle in C
Answers were Sorted based on User's Feedback
Answer / ketan bhavsar
Using a rectangle(int,int,int,int)function of c graphics.
| Is This Answer Correct ? | 431 Yes | 38 No |
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 |
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 |
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 |
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 |
Answer / suganya
using rectangle(int right,int top,int left,int bottom) in
graphics.h
| Is This Answer Correct ? | 83 Yes | 21 No |
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 |
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 |
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 |
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,
#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); }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too
main() { printf("%x",-1<<4); }
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
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; }