write a program to draw some basic shapes.



#include
#include

void main()
{
int gd=DETECT, gm;
int poly[12]={350,450, 350,410, 430,400, 350,350, 300,430, 350,450 };
initgraph(&gd, &gm, “”);

circle(100,100,50);
outtextxy(75,170, “Circle”);
rectangle(200,50,350,150);
outtextxy(240, 170, “Rectangle”);
ellipse(500, 100,0,360, 100,50);
outtextxy(480, 170, “Ellipse”);
line(100,250,540,250);
outtextxy(300,260,”Line”);

sector(150, 400, 30, 300, 100,50);
outtextxy(120, 460, “Sector”);
drawpoly(6, poly);
outtextxy(340, 460, “Polygon”);
getch();
closegraph();
}

6 comments:

  1. i need program for this shape
    1
    2 3
    4 5 6
    7 8 9 10.
    like..
    and
    *
    * *
    * * *
    * * * *
    * * *
    * *
    *

    pls give me soure code for this programs.
    pls send to 9976718655(rajkumar).

    ReplyDelete
    Replies
    1. int i=0,j=0,num=3;
      for(i=-num;i<=num;i++)
      {
      for(j=-num;j<=num;j++)
      {
      if(abs(i)+abs(j)<=num)
      printf("*");
      }
      printf("\n");
      }

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. i need program for this shape
    *********
    *********
    **
    **
    **
    i need program for this shape
    plz send 2 06payu@gmail.com

    ReplyDelete
  4. I need a program for this shape
    **********
    *________*
    *________*
    *________*
    *________*
    *________*
    *________*
    *________*
    *________*
    **********

    ReplyDelete
  5. Hi all,,

    Its link for more star Shapes...

    http://lernc.blogspot.com/2011/12/c-program-to-print-asterisk-star.html

    ReplyDelete