Question: what's the output ? void func(stacks) { if ( s.empty ()) { return; } stack rest = s; rest.pop (); func(rest); cout s.top() ; }
void func(stacks) \{ if ( s.empty ()) \{ return; \} stack rest = s; rest.pop (); func(rest); cout s.top()" "; \} int main() \{ stacks; s.push ('A'); s.push('B'); s.push ('C'); s.push('D'); func (s); \}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
