Skip to content

Commit c52df78

Browse files
authored
Update Stack.md
1 parent 6f23e09 commit c52df78

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Stack.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@ Deletion of an element from the top of the stack is called pop operation. The va
5454
The underflow condition occurs when we try to delete an element from an already empty stack.
5555

5656
```c
57-
57+
void Pop()
58+
{
59+
if (Top == -1)
60+
{
61+
printf("\n Stack Underflow!");
62+
}
63+
else
64+
{
65+
printf("Element %d is popped", array[Top]);
66+
Top = Top -1;
67+
}
68+
}
5869
```
5970

6071
### Peek or Top : Visiting each element of the stack

0 commit comments

Comments
 (0)