I make this for balancing paranthesis of equation but i think it is wrong check and correct it
Posted
by muhammadlodhi
on Stack Overflow
See other posts from Stack Overflow
or by muhammadlodhi
Published on 2010-04-16T16:00:56Z
Indexed on
2010/04/16
16:03 UTC
Read the original article
Hit count: 164
c
int main(){ char i,input[30],close,open; for(i=0;i<='.';i++){ printf("enter equation"); scanf("%c",input[i]); if(input[i]=='(') input++; input[i]=open; else if(input[i]==')') input[i]--; input[i]=close; else if(open[i]==close[i]) { printf("paranthesis are balance"); } else printf("paranthesis are not balance"); }
getch(); return 0;
}
© Stack Overflow or respective owner