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();
}

Related Links :

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


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!