title: No display of array
body: <p>The following is my implementation of the SPOJ problem: <a href="http://www.spoj.com/problems/FCTRL2/" rel="nofollow">http://www.spoj.com/problems/FCTRL2/</a> </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main()
  {
      int t;
      scanf("%d",&amp;t);
      while(t--)
      {
          int carry=0,k,i,j,num,arr[1000]={1};
          scanf("%d",&amp;num);
          for(i=1;i&lt;=num;i++)
          {
              for(j=0;j&lt;=k;j++)
              {
                  arr[j]=arr[j]*i+carry;
                  carry=arr[j]/10;
                  arr[j]=arr[j]%10;
              }
              while(carry)
              {
                  k++;
                  arr[k]=carry%10;
                  carry/=10;
              }
          }
          for(i=k;i&gt;=0;i--)//doubt
          {
              printf("%d",arr[i]);
          }
          printf("\n");
      }
  
      return 0;
  }
  </code></pre>
  
  <p>I guess there is a mistake in displaying array in reverse direction, but when I change the condition i.e for(i=0;i&lt;=k;i++) it prints the array.
  Please help me solve this problem.</p>