Why only test case 0 is pass ? else test 1&2 is fail

#include
using namespace std;
void b(char *a,int i,int o,int c,int n){
if(c==n){
cout<<a<<endl;
return;
}
if(o>c){
a[i]=’)’;
b(a,i+1,o,c+1,n);
}
if(o<n){
a[i]=’(’;
b(a,i+1,o+1,c,n);
}

}

int main() {
int n;cin>>n;char a[1000];
b(a,0,0,0,n);
return 0;
}