RECURSION-TOWER OF HANOI--sample case passes but test cases give wrong answer

link to question: https://hack.codingblocks.com/contests/c/457/358

#include
using namespace std;

int c=0;
void toh(int n,int b, int e,int a)
{
if (n==1){
cout<<“Move “<<“1th disk from T”<<b<<” to T”<<e<<endl;
c++;
return;
}

toh(n-1,b,a,e);
cout<<"Move "<<n<<"th disk from T"<<b<<" to T"<<e<<endl;
c++;
toh(n-1,a,e,b);
return;

}

int main() {
int n;
cin>>n;
toh(n,1,2,3);
cout<<c;
return 0;
}

#include
using namespace std;

int c=0;
void toh(int n,int b, int e,int a) /// where b is the starting rod,e is the destination rod,a is the helping rod
{
if (n==0){
return;
}
toh(n-1,b,a,e);
c++;
cout<<“Move “<<n<<“th disc from T”<<b<<” to T”<<e<<endl;
toh(n-1,a,e,b);
return;
}

int main() {
int n;
cin>>n;
toh(n,1,2,3);
cout<<c<<endl;
return 0;
}
/* there was a small mistake in cout<<C u did’nt put endl and N==1 case is unnecesary */