#include<stdio.h>
#include<conio.h>
#include<graphics.h>
void main()
{
int gd=DETECT,gm,i,j,p[]={180,184,180,194,350,194,350,184,180,184};
int p1[]={390,175,390,189,404,189,404,175,390,175};
int p2[]={104,164,150,180,390,180,390,184,150,184,104,168,104,164};
int p3[]={180,150,220,150,280,180,272,180,218,154,180,154,180,150};
int p4[]={210,75,210,85,200,85,200,95,210,95,210,105,200,105,200,140,190,150,180,140,180,105,170,105,170,95,180,95,180,85,170,85,170,75,210,75};
initgraph(&gd,&gm,"C:\\TurboC3\\BGI");
//Gong
setfillstyle(1,YELLOW);
fillellipse(100,200,20,20);
setfillstyle(1,RED);
fillellipse(100,200,3,3);
//Arrow between Gong and Hammer
outtextxy(97,169,"^");
outtextxy(97,170,"|");
//Hammer
setfillstyle(1,1);
fillellipse(100,165,4,4);
//Hammer Rod
setfillstyle(5,BROWN);
fillpoly(7,p2);
//Iron Armature
setfillstyle(1,12);
fillpoly(5,p);
//Rod Base
setfillstyle(1,7);
fillpoly(5,p1);
//Electromagnet
line(180,220,210,220);
line(320,220,350,220);
line(180,220,180,325);
line(210,220,210,325);
line(320,220,320,325);
line(350,220,350,325);
arc(265,325,180,360,55);
arc(265,325,180,360,85);
setfillstyle(1,BROWN);
bar(180,220,210,325);
bar(320,220,350,325);
//wire
setcolor(WHITE);
for(i=0;i<=90;i=i+5)
{
ellipse(195,240+i,-20,200,18,5);
ellipse(335,240+i,-20,200,18,5);
}
line(210,332,320,332);
line(350,235,397,235);
line(397,235,397,189);
line(180,235,150,235);
line(150,235,150,435);
line(150,435,435,435);
line(435,435,435,400);
line(410,400,460,400);
line(425,390,445,390);
line(410,380,460,380);
line(425,370,445,370);
line(435,370,435,150);
for(j=0;j<=30;j++)
{
setcolor(BROWN);
arc(265,325,180,360,55+j);
}
setfillstyle(1,4);
bar(425,100,455,140);
setcolor(WHITE);
setfillstyle(1,BLUE);
fillellipse(440,120,10,10);
line(435,123,435,90);
line(445,135,445,115);
line(445,135,435,150);
line(435,90,250,90);
line(250,90,220,100);
line(220,100,210,100);
setfillstyle(5,BROWN);
fillpoly(7,p3);
setfillstyle(4,YELLOW);
fillpoly(18,p4);
//all text
outtextxy(85,230,"Gong");
outtextxy(77,150,"Hammer");
outtextxy(140,60,"Contact Screw");
outtextxy(460,115,"Bell Push");
outtextxy(240,150,"Springy Metal Strip");
outtextxy(220,200,"Iron Armature");
outtextxy(220,420,"Electromagnet");
outtextxy(360,275,"Soft Iron");
outtextxy(375,290,"Core");
settextstyle(3,0,2);
outtextxy(130,10,"AN ELECTRIC BELL AND ITS WIRING");
outtextxy(250,435,".........Sukhvir....");
getch();
closegraph();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.