#include
#include
#include
#include
#include
void main()
{
int gd=DETECT,gm;
int ch;
clrscr();
while(1)
{
printf("******Line Styles*******\n");
printf("\n1.Solid Line");
printf("\n2.Dotted Line");
printf("\n3.Center Line");
printf("\n4.Dashed Line");
printf("\n5.Userbit Line");
printf("\n6.Exit");
printf("\n\nEnter your choice:\n");
scanf("%d",&ch);
switch(ch)
{
case 1:
clrscr();
initgraph(&gd,&gm," ");
setlinestyle(0,1,3);
line(100,30,250,250);
getch();
cleardevice();closegraph();
break;
case 2:
clrscr();
initgraph(&gd,&gm," ");
clrscr();
setlinestyle(1,1,3);
line(100,30,250,250);
getch();
cleardevice();closegraph();
break;
case 3:
clrscr();
initgraph(&gd,&gm," ");
setlinestyle(2,1,3);
line(100,30,250,250);
getch();
cleardevice();closegraph();
break;
case 4:
clrscr();
initgraph(&gd,&gm," ");
setlinestyle(3,1,3);
line(100,30,250,250);
getch();
cleardevice();
closegraph();
break;
case 5:
clrscr();
initgraph(&gd,&gm," ");
setlinestyle(4,1,3);
line(100,30,250,250);
getch();
cleardevice();closegraph();
break;
case 6:
exit(0);
}
}
}
No comments:
Post a Comment