Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 / sunny khanna

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int driver,mode;
driver=DETECT;
initgraph(&driver,&mode,"c:\\tc\\bgi");
rectangle(100,100,250,250);
getche();
closegraph();
}

Is This Answer Correct ?    46 Yes 11 No

how can u draw a rectangle in C..

Answer / venkatesh

line(x1,y1,x2,y1)
line(x1,y2,x2,y2)
line(x1,y1,x1,y2)
line(x2,y1,x2,y2)

Is This Answer Correct ?    51 Yes 17 No

how can u draw a rectangle in C..

Answer / srinivas.m

#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 ?    25 Yes 5 No

how can u draw a rectangle in C..

Answer / shrikant

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,n;
clrscr();
printf("Enter the value of n\n");
scanf("%d",&n);
for(i=0;i<=n;i++)
{
for(j=0;j<=2*n;j++)
{
if((i>0 && i<n) && (j>0 && j<2*n))
{
printf(" ");
}
else
{
printf("* ");
}
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    23 Yes 4 No

how can u draw a rectangle in C..

Answer / santosh

line(x1,y1,x2,y1)
line(x1,y2,x2,y2)
line(x1,y1,x1,y2)
line(x2,y1,x2,y2)

initgraph(&gd, &gm, "c:\\turboc3\\bgi " );
rectangle(200,50,350,150);

Is This Answer Correct ?    20 Yes 12 No

how can u draw a rectangle in C..

Answer / prabhanjan

#include
#include
#include
main()
{
int gd=DETECT, gm,x,y;
int arr[]={540,220,590,270,570,320,510,320,490,270,540,220};
initgraph(&gd,&gm,"c:\\tc\\bgi");
x=getmaxx();
y=getmaxy();
setcolor(GREEN);
printf(" \n value of x = %d",x);
printf(" and the value of y = %d",y);

rectangle(5,40,140,200);
outtextxy(x/30+15,y/8+5,"Rectangle");

drawpoly(6,arr);
outtextxy(515,270,"Polygon");
setcolor(RED);
line(0,49,639,479);
line(0,0,0,479);
line(0,0,639,0);
line(639,0,639,479);

getch();
closegraph();
restorecrtmode();
}

Is This Answer Correct ?    21 Yes 13 No

how can u draw a rectangle in C..

Answer / sabarinathan

void main()
{
int n=0,i=0;
printf("how many lines should rectangle can occupied");
scanf("%d",n);
printf("____________");
prinf("/n");
for(i=0;i<=n;i++)
{
printf("| |");
printf("/n");
}
printf("____________")
}

Is This Answer Correct ?    5 Yes 0 No

how can u draw a rectangle in C..

Answer / joker

why do you want to draw rectangle using C if you can do it
in a paper its more simpler and faster, no developer
required hence cost effective.

Is This Answer Correct ?    9 Yes 5 No

how can u draw a rectangle in C..

Answer / shruti

include graphics.h

rectangle(int,int,int,int)

closegraph()

Is This Answer Correct ?    17 Yes 14 No

how can u draw a rectangle in C..

Answer / vignesh

#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
int main()
{
int driver,mode;
detectgraph(&driver,&mode);
initgraph(&driver,&mode,"...\\bgi");
setcolor(8);
for(i=10;i<201;i++)
{
sound(i);
rectangle(200,50,350,150);
delay(1000);
nosound();
}
getch();
}

Is This Answer Correct ?    7 Yes 4 No

Post New Answer

More C Code Interview Questions

int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }

1 Answers  


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

0 Answers   Honeywell,


main() { while (strcmp(“some”,”some\0”)) printf(“Strings are not equal\n”); }

1 Answers  


main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }

6 Answers  


#define a 10 int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } void foo() { #undef a #define a 50 }

3 Answers  


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


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

2 Answers   IBM,


Write a c program to search an element in an array using recursion

1 Answers   Wipro,


how can i cast a char type array to an int type array

2 Answers  


struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 Answers  


What is data _null_? ,Explain with code when u need to use it in data step programming ?

0 Answers   Abbott,


Categories