03 C | How to check balanced parenthesis

preview_player
Показать описание
In this video we will learn to check whether a given expression has a balanced parenthesis using C programming language.

Example
If we have the expression: (a+b)*c
Then we can say that the parenthesis is balanced.

But if we have an expression like: a+b)*c
Then we can say that the parenthesis is not balanced.

You can use this concept in designing a calculator were parenthesis ( and ) are used.
Рекомендации по теме
Комментарии
Автор

thanks for easiest approach, without stacks

narendrareddygade
Автор

thanks, I was looking for this. very helpful

rohaanjoshi
Автор

This wouldn't work for ')(' or expression like that. Even though the opening is equal to the closing, it's not balanced

sbk
Автор

Can you do this example in C#, with Char array ? :)

redstarmarkolo