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 / priyanka

#include<graphics.h>
#include<conio.h>
#include<stdio.h>
void main()
{
int gdrive=DETECT,gmode;
initgraph (&gdrive,&gmode,"c:\tc\bin");
rectangle((50,50),(50,100),(100,100),(100,50));
getch();
}

Is This Answer Correct ?    2 Yes 2 No

how can u draw a rectangle in C..

Answer / logeshwaran

rectangle

Is This Answer Correct ?    2 Yes 2 No

how can u draw a rectangle in C..

Answer / pramod

printf("Rectangle");

Is This Answer Correct ?    2 Yes 2 No

how can u draw a rectangle in C..

Answer / anjali

by using C compiler and keyboard.

Is This Answer Correct ?    1 Yes 1 No

how can u draw a rectangle in C..

Answer / priyanka

rectangle(int,int,int,int);
and with few parameters
and der's no necessity of using graphics.h
n sorry if i am wrong. . .

Is This Answer Correct ?    1 Yes 1 No

how can u draw a rectangle in C..

Answer / nithiya

#include<grpahics.h>
void main()
{
int gd=0,gm;
initgraph(&gd,&gm,"x:\\tc\\bgi");
rectangle(int,int,int,int);
}

Is This Answer Correct ?    1 Yes 1 No

how can u draw a rectangle in C..

Answer / amaresh

rect(x1,y2,x2,y2)

Is This Answer Correct ?    0 Yes 0 No

how can u draw a rectangle in C..

Answer / akshay

Include graphics library
then either use rectangle function in it or using line fuction
adjust coordinates for it to make a rectangle

Is This Answer Correct ?    1 Yes 2 No

how can u draw a rectangle in C..

Answer / ram kumar

include the header file graphics.h
use the built in function rect(x1,y1,x2,y2)
such that (x1,y1) and (x2,y2) are the coordinates

Is This Answer Correct ?    10 Yes 12 No

how can u draw a rectangle in C..

Answer / nitheesh

#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int left, top, right, bottom;

/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");

/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg
(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}

Is This Answer Correct ?    2 Yes 4 No

Post New Answer

More C Code Interview Questions

main() { extern i; printf("%d\n",i); { int i=20; printf("%d\n",i); } }

1 Answers  


struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above

2 Answers   HCL,


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

2 Answers  


write a program in c to merge two array

2 Answers  


How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.

2 Answers  






main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number

1 Answers   HCL, rsystems,


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

0 Answers  


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

0 Answers   Nagarro,


void main() { int const * p=5; printf("%d",++(*p)); }

3 Answers   Infosys, Made Easy, State Bank Of India SBI,


Categories