Prac09 Paranthesis Checker
Prac09 Paranthesis Checker
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char stack[MAX_SIZE];
if (top == MAX_SIZE - 1) {
printf("Overflow stack!\n");
return;
top++;
stack[top] = data;
char pop() {
if (top == -1) {
printf("Empty stack!\n");
top--;
return data;
return 1;
return 1;
return 1;
} else {
return 0;
int i;
push(text[i]);
if (top == -1) {
if (top == -1) {
} else {
// Main function
int main() {
char text[MAX_SIZE];
scanf("%s", text);
if (isBalanced(text)) {
} else {
return 0;
OUTPUT: