Print reverse

whenever i run below code , it shows output: success but when i submit the code it shows that the test case have wrong answer. please tell me what i am doing wrong

#include
using namespace std;
int main() {

int n,a,reverse;

if((n>=0) &&(n<=1000000000))
{
  cin>>n;
}

while(n!=0)
{
  a=n%10;
  reverse=(reverse*10)+a;
  n=n/10;
}

cout<<reverse;
return 0;

}

Initialise reverse variable with zero.