title: this C++ code always gives same output
body: <p>Here is a program that checks whether a number and its reverse are equal</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;conio.h&gt;
  
  using namespace std;
  
  int main()
  {
   int num,n,digit,j,newNum;
   n=num;
   j=1;
   newNum=0;
  
  cout&lt;&lt;"Enter a number\n";
  cin&gt;&gt;num;
  
  while(n&gt;=1)
  {
     digit=n%10;
  n=n/10;
  digit=digit*j;
  newNum=newNum+digit;
  j=j*10;        
  }
    cout&lt;&lt;"The reverse of given number is:"&lt;&lt;newNum&lt;&lt;endl;
    if(num==newNum)
    cout&lt;&lt;"The given number and its reverse are equal";
    else
    cout&lt;&lt;"The given number and its reverse are not equal";
    getch();   
  } 
  </code></pre>
  
  <p>`
  This program accept a number as input and then find its reverse and then check if reverse is equal to number or not.
          whenever I run this program and whatever number I give as input, it gives the reverse number 1975492148.
          Can anyone please help me with identifying the cause of it?</p>