title: Divisible Problem on Hackerearth Partially Accepted
body: <p>I completed a challenge in HackerEarth using C but the solution is only partially accepted. I tried to change the data type also but no success.</p>
  <p>Question is:</p>
  <blockquote>
  <p>You are given an array A of size N that contains integers. Here, N is an even number. You are required to perform the following operations:</p>
  <ul>
  <li><p>Divide the array of numbers in two equal halves<br />
  Note: Here, two equal parts of a test case are created by dividing the array into two equal parts.</p>
  </li>
  <li><p>Take the first digit of the numbers that are available in the first half of the array (first 50% of the test case)</p>
  </li>
  <li><p>Take the last digit of the numbers that are available in the second half of the array (second 50% of the test case)</p>
  </li>
  <li><p>Generate a number by using the digits that have been selected in the above steps</p>
  </li>
  </ul>
  <p>Your task is to determine whether the newly-generated number is divisible by 11.</p>
  </blockquote>
  <p>My solution is:</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;math.h&gt;
  
  int main(){
      int N;
      scanf(&quot;%d&quot;,&amp;N);
      int A[N];
  
      for(int i = 0;i &lt; N;i++)
          scanf(&quot;%d&quot;,&amp;A[i]);
      
      long int sum = 0;
      for(int i = 0;i &lt; N/2;i++){
          int digits =(int)log10(A[i]);
          int first_digit = (int)(A[i] / pow(10,digits));
          sum = (sum*10) + first_digit;
      }
  
      for(int i = N/2;i &lt; N;i++){
          int last_digit = A[i] % 10;
          sum = (sum*10)+last_digit;
      }
  
      sum % 11 == 0? printf(&quot;OUI&quot;):printf(&quot;NON&quot;);
      return 0;
  }
  </code></pre>