#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<stdio.h>
#include<dos.h>
void main()
{
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"C:\\Turboc3\\BGI");
rectangle(120,40,230,60);
moveto(126,45); outtext("Application");
rectangle(120,70,230,90);
moveto(126,75); outtext("Presentation");
rectangle(120,100,230,120);
moveto(126,105); outtext("Session");
rectangle(120,130,230,150);
moveto(126,135); outtext("Transport");
rectangle(120,160,230,180);
moveto(126,165); outtext("Network");
rectangle(120,190,230,210);
moveto(126,195); outtext("Physical");
rectangle(120,220,230,240);
moveto(126,225); outtext("Application");
line(175,60,175,70);
line(175,90,175,100);
line(175,120,175,130);
line(175,150,175,160);
line(175,180,175,190);
line(175,210,175,220);
rectangle(300,40,410,60);
moveto(310,45); outtext("Application");
rectangle(300,70,410,90);
moveto(310,75); outtext("Presentation");
rectangle(300,100,410,120);
moveto(310,105); outtext("Session");
rectangle(300,130,410,150);
moveto(310,135); outtext("Transport");
rectangle(300,160,410,180);
moveto(310,165); outtext("Network");
rectangle(300,190,410,210);
moveto(310,195); outtext("Data link");
rectangle(300,220,410,240);
moveto(310,225); outtext("Physical");
line(355,60,355,70);
line(355,90,355,100);
line(355,120,355,130);
line(355,150,355,160);
line(355,180,355,190);
line(355,210,355,220);
setlinestyle(3,0,0);
line(230,50,300,50);
line(230,80,300,80);
line(230,110,300,110);
line(230,140,300,140);
line(230,170,300,170);
line(230,200,300,200);
line(230,230,300,230);
setlinestyle(0,0,0);
rectangle(97,10,110,30);
moveto(101,15); outtext("D");
int y1=10,y2=30;
delay(2000);
for(int i=1;i<=7;i++)
{
cleardevice();
rectangle(120,40,230,60);
moveto(126,45); outtext("Application");
rectangle(120,70,230,90);
moveto(126,75); outtext("Presentation");
rectangle(120,100,230,120);
moveto(126,105); outtext("Session");
rectangle(120,130,230,150);
moveto(126,135); outtext("Transport");
rectangle(120,160,230,180);
moveto(126,165); outtext("Network");
rectangle(120,190,230,210);
moveto(126,195); outtext("Data link");
rectangle(120,220,230,240);
moveto(126,225); outtext("Physical");
line(175,60,175,70);
line(175,90,175,100);
line(175,120,175,130);
line(175,150,175,160);
line(175,180,175,190);
line(175,210,175,220);
rectangle(300,40,410,60);
moveto(310,45); outtext("Application");
rectangle(300,70,410,90);
moveto(310,75); outtext("Presentation");
rectangle(300,100,410,120);
moveto(310,105); outtext("Session");
rectangle(300,130,410,150);
moveto(310,135); outtext("Transport");
rectangle(300,160,410,180);
moveto(310,165); outtext("Network");
rectangle(300,190,410,210);
moveto(310,195); outtext("Data link");
rectangle(300,220,410,240);
moveto(310,225); outtext("Physical");
line(355,60,355,70);
line(355,90,355,100);
line(355,120,355,130);
line(355,150,355,160);
line(355,180,355,190);
line(355,210,355,220);
setlinestyle(3,0,0);
line(230,50,300,50);
line(230,80,300,80);
line(230,110,300,110);
line(230,140,300,140);
line(230,170,300,170);
line(230,200,300,200);
line(230,230,300,230);
setlinestyle(0,0,0);
y1=y1+30;
y2=y2+30;
rectangle(97,y1,110,y2);
moveto(101,y1+5); outtext("D");
int x1=97;
for(int j=i;j>0;j--)
{
rectangle(x1-13,y1,x1,y2);
x1=x1-13;
switch(i)
{
case 1 : moveto(85,45); outtext("1");
break;
case 2 : moveto(85,75); outtext("1");
moveto(72,75); outtext("2");
break;
case 3 : moveto(85,105); outtext("1");
moveto(72,105); outtext("2");
moveto(59,105); outtext("3");
break;
case 4 : moveto(85,135); outtext("1");
moveto(72,135); outtext("2");
moveto(59,135); outtext("3");
moveto(46,135); outtext("4");
break;
case 5 : moveto(85,165); outtext("1");
moveto(72,165); outtext("2");
moveto(59,165); outtext("3");
moveto(46,165); outtext("4");
moveto(33,165); outtext("5");
break;
case 6 : moveto(85,195); outtext("1");
moveto(72,195); outtext("2");
moveto(59,195); outtext("3");
moveto(46,195); outtext("4");
moveto(33,195); outtext("5");
moveto(20,195); outtext("6");
break;
case 7 : moveto(85,225); outtext("1");
moveto(72,225); outtext("2");
moveto(59,225); outtext("3");
moveto(46,225); outtext("4");
moveto(33,225); outtext("5");
moveto(20,225); outtext("6");
moveto(8,225); outtext("7");
break;
}
}
delay(800);
}
y1=250,y2=270;
for(i=7;i>=0;i--)
{
cleardevice();
rectangle(120,40,230,60);
moveto(126,45); outtext("Application");
rectangle(120,70,230,90);
moveto(126,75); outtext("Presentation");
rectangle(120,100,230,120);
moveto(126,105); outtext("Session");
rectangle(120,130,230,150);
moveto(126,135); outtext("Transport");
rectangle(120,160,230,180);
moveto(126,165); outtext("Network");
rectangle(120,190,230,210);
moveto(126,195); outtext("Data link");
rectangle(120,220,230,240);
moveto(126,225); outtext("Physical");
line(175,60,175,70);
line(175,90,175,100);
line(175,120,175,130);
line(175,150,175,160);
line(175,180,175,190);
line(175,210,175,220);
rectangle(300,40,410,60);
moveto(310,45); outtext("Application");
rectangle(300,70,410,90);
moveto(310,75); outtext("Presentation");
rectangle(300,100,410,120);
moveto(310,105); outtext("Session");
rectangle(300,130,410,150);
moveto(310,135); outtext("Transport");
rectangle(300,160,410,180);
moveto(310,165); outtext("Network");
rectangle(300,190,410,210);
moveto(310,195); outtext("Data link");
rectangle(300,220,410,240);
moveto(310,225); outtext("Physical");
line(355,60,355,70);
line(355,90,355,100);
line(355,120,355,130);
line(355,150,355,160);
line(355,180,355,190);
line(355,210,355,220);
setlinestyle(3,0,0);
line(230,50,300,50);
line(230,80,300,80);
line(230,110,300,110);
line(230,140,300,140);
line(230,170,300,170);
line(230,200,300,200);
line(230,230,300,230);
setlinestyle(0,0,0);
y1=y1-30;
y2=y2-30;
int x1=420;
for(int j=i;j>0;j--)
{
rectangle(x1,y1,x1+13,y2);
rectangle(x1+13,y1,x1+26,y2);
moveto(424,y1+5); outtext("D");
x1=x1+13;
switch(i)
{
case 1 : moveto(435,45); outtext("1");
break;
case 2 : moveto(435,75); outtext("1");
moveto(448,75); outtext("2");
break;
case 3 : moveto(435,105); outtext("1");
moveto(448,105); outtext("2");
moveto(461,105); outtext("3");
break;
case 4 : moveto(435,135); outtext("1");
moveto(448,135); outtext("2");
moveto(461,135); outtext("3");
moveto(474,135); outtext("4");
break;
case 5 : moveto(435,165); outtext("1");
moveto(448,165); outtext("2");
moveto(461,165); outtext("3");
moveto(474,165); outtext("4");
moveto(487,165); outtext("5");
break;
case 6 : moveto(435,195); outtext("1");
moveto(448,195); outtext("2");
moveto(461,195); outtext("3");
moveto(474,195); outtext("4");
moveto(487,195); outtext("5");
moveto(500,195); outtext("6");
break;
case 7 : moveto(435,225); outtext("1");
moveto(448,225); outtext("2");
moveto(461,225); outtext("3");
moveto(474,225); outtext("4");
moveto(487,225); outtext("5");
moveto(500,225); outtext("6");
moveto(513,225); outtext("7");
break;
}
}
delay(800);
}
rectangle(420,10,433,30);
moveto(424,15); outtext("D");
getch();
}
---------------------------------------------------
OUTPUT
---------------------------------------------------
OUTPUT
---------------------------------------------------
No comments:
Post a Comment