title: Program failed in executing step by step
body: <pre><code>#include&lt;math.h&gt;
  #include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  int binaryToDecimal(long binarynum){
      int decimalnum = 0, temp = 0, remainder;
      while(binarynum!=0){
          remainder = binarynum % 10;
          remainder = binarynum / 10;
          decimalnum = decimalnum+remainder*pow(2,temp);
          temp++;
      }
      return decimalnum;
  }
  long decimalToBinary(int n){
      int remainder;
      long binary = 0,i = 1;
      while(n != 0){
          remainder = n % 2;
          n = n / 2;
          binary = binary + (remainder*i);
          i = i*10;
      }
      return binary;
  }
  int main(){
      int quotient, rem,decimalnum1,decimalnum2;
      long binarynum1, binarynum2;
  
      printf("Enter dividend binary number::");
      scanf("%ld",&amp;binarynum1);
  
      printf("Enter divisor binary number::");
      scanf("%ld",&amp;binarynum2);
      /// execution stops from here.
      decimalnum1 = binaryToDecimal(binarynum1);
      decimalnum2 = binaryToDecimal(binarynum2);
      quotient = decimalnum1/decimalnum2;
      rem = decimalnum1%decimalnum2;
      printf("Quotient  is: %ld",decimalToBinary(quotient));
      printf("Remainder is: %ld",decimalToBinary(rem));
      getch();
  }
  </code></pre>
  
  <p>I was working  with the program to perform division between binary numbers. But 
  the program execution stops after 6th statement. I tried to change the variable types but still having problem. <br><br>
  Output of the program execution is here.</p>
  
  <p><a href="https://i.stack.imgur.com/2p04h.png" rel="nofollow noreferrer">Output</a></p>