Jump to content


Photo

C programs


  • Please log in to reply
1 reply to this topic

#1 Yeshna12

Yeshna12

    Member

  • Members
  • PipPip
  • 20 posts

Posted 28 October 2006 - 01:53 AM

#include<graphics.h>
#include<conio.h>
main()
{
int i,radius,midx,midy;
int gd=DETECT, gm;
initgraph(&gd,&gm,"");
midx=getmaxx()/2;
midy=getmaxy()/2;
radius=60;
setfillstyle(SOLID_FILL,RED);
bar(midx-4.5*radius,midy-radius*3,midx+4.5*radius,midy-radius);
setfillstyle(SOLID_FILL,GREEN);
bar(midx-4.5*radius,midy+radius,midx+4.5*radius,midy+3*radius);
setfillstyle(SOLID_FILL,WHITE);
bar(midx-4.5*radius,midy-radius,midx+4.5*radius,midy+radius);
setfillstyle(SOLID_FILL,BLUE);
fillellipse(midx,midy,radius,radius);
setfillstyle(SOLID_FILL,WHITE);
fillellipse(midx,midy,radius-5,radius-5);
for(i=0;i<361;i+=24)
{
setfillstyle(SOLID_FILL,BLUE);
pieslice(midx,midy,i,i+5,radius);
}
setfillstyle(SOLID_FILL,BLUE);
fillellipse(midx,midy,5,5);
getch();
closegraph();
return 0;
}

Use Borland C++ or Turbo c++ to compile

#2 engines

engines

    Immortal Member

  • Members
  • PipPipPipPipPip
  • 1,196 posts

Posted 28 October 2006 - 09:50 AM

#include<graphics.h>
#include<conio.h>
main()
{
int i,radius,midx,midy;
int gd=DETECT, gm;
initgraph(&gd,&gm,"");
midx=getmaxx()/2;
midy=getmaxy()/2;
radius=60;
setfillstyle(SOLID_FILL,RED);
bar(midx-4.5*radius,midy-radius*3,midx+4.5*radius,midy-radius);
setfillstyle(SOLID_FILL,GREEN);
bar(midx-4.5*radius,midy+radius,midx+4.5*radius,midy+3*radius);
setfillstyle(SOLID_FILL,WHITE);
bar(midx-4.5*radius,midy-radius,midx+4.5*radius,midy+radius);
setfillstyle(SOLID_FILL,BLUE);
fillellipse(midx,midy,radius,radius);
setfillstyle(SOLID_FILL,WHITE);
fillellipse(midx,midy,radius-5,radius-5);
for(i=0;i<361;i+=24)
{
setfillstyle(SOLID_FILL,BLUE);
pieslice(midx,midy,i,i+5,radius);
}
setfillstyle(SOLID_FILL,BLUE);
fillellipse(midx,midy,5,5);
getch();
closegraph();
return 0;
}

Use Borland C++ or Turbo c++ to compile


Great signature block there.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users