-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.c
More file actions
92 lines (83 loc) · 1.84 KB
/
stack.c
File metadata and controls
92 lines (83 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include <graphics.h>
#include <dos.h>
#include <conio.h>
#include <stdio.h>
#include <windows.h>
int main()
{
int i, j,gd = DETECT,gm;
initgraph(&gd,&gm,"C:\\TC\\BGI");
settextstyle(DEFAULT_FONT,HORIZ_DIR,5);
outtextxy(25,50,"STACK IMPLEMENTATION");
getch();
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(25,100,"DATA FOR STACK - 75, 89, 168, 110, 220");
getch();
//Making container
line(200,200,200,400);
line(200,400,450,400);
line(450,400,450,200);
// rectangle(250,250,400,350);
// rectangle(500,300,600,350);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(25,200,"PUSH");
outtextxy(25,220,"OPERATION");
outtextxy(290,420,"STACK");
j=60;
for(int a=0;a<3;a++){
j=60;
for(i=0;i<5;i++){
// setcolor(15);
setcolor(15);
rectangle(500,450-j,600,500-j);
delay(2000);
setcolor(0);
rectangle(500,450-j,600,500-j);
// setcolor(15);
j=j+60;
}
setcolor(15);
rectangle(400,130,500,190);
delay(2000);
setcolor(0);
rectangle(400,130,500,190);
setcolor(15);
rectangle(280,130,380,190);
delay(2000);
setcolor(0);
rectangle(280,130,380,190);
i=65;
for(int z = 0;z<3;z++)
{
setcolor(15);
rectangle(280,130+i,380,190+i);
delay(2000);
setcolor(0);
rectangle(280,130+i,380,190+i);
setcolor(15);
i=i+65;
}
if(a==0){
int a=i-65; // for going back to the last cell.
rectangle(280,130+a,380,190+a);
setcolor(15);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(130+a-20,190+a-30,"75");
}
if(a==1){
int a=i-65; // for going back to the last cell.
rectangle(280,130+a,380,190+a);
setcolor(15);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(130+a-20,190+a-30,"75");
a=i-130; // for going back to the last cell.
rectangle(280,130+a,380,190+a);
setcolor(15);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(130+a-40,190+a-30,"110");
}
}
// delay(5000);
getch();
return 0;
}