Code running fine on pc but giving wrong result in your platform

Code to reverse a number:

#include
using namespace std;
int main() {
int n,count,i;
int mul = 1,rev = 0;
cin>>n;
int a = n;
while(a!=0)
{
a=a/10;
count++;
}
while(n!=0)
{
for(i=0;i<count-1;i++)
{
mul = mul*10;
}
rev = (n%10)*mul + rev;
mul = 1;
count–;
n=n/10;
}
cout<<rev<<endl;
return 0;
}

@Naman-Taneja-2420178691408660 range of number is quite big, int will not work

maam it is not even running for a small custom input

And also the given range lies in th range of int

i.e. -2,147,483,648 to 2,147,483,647

in CB platform it gives 0 for every input

@Naman-Taneja-2420178691408660 please share your code by saving it on cb ide

maam please try the same code on Sublime text if you have it

the code gives correct result

@Naman-Taneja-2420178691408660 initialise count with 0, then it is running fine