designing a pushdown automata for the language a^n b c^(n+2), n>0 I have been asked to implement the automata for the above language .. please help?

I tried popping a 2 (c)s everytime I push an (a) on to the stack but it seems not to work with odd number of (a)s ....

It's a^n b c^(n+2), and if you can't even use basic parentheses how are you even human?

PROTIP: a^n b c^n c c is the same thing.

commented: no helpful input, OP already clarified that in his post -3

Ok i apologize do u have any suggestions other than costructive criticism which i appreciate..

for all a's and b's push onto the stack , then for first two c's pop b and for the remaining c's pop a's .hence solved1

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.