title: Program to find factorials for given test cases
body: <p>Input<br>
  An integer t, 1&lt;=t&lt;=100, denoting the number of test cases, followed by t lines, each containing a single integer n, 1&lt;=n&lt;=100.</p>
  
  <p>Output<br>
  For each integer n given at input, display a line with the value of n!</p>
  
  <p>I have typed the code below and it doesn't get accepted on codechef.<br>
  I don't know why.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  double fact(int n);
  void disp(double t);
  
  int main() {
    int a, i, c[100];
    scanf("%d", &amp;a);
    for (i = 0; i &lt; a; i++) {
      scanf("%d", &amp;c[i]);
    }
    for (i = 0; i &lt; a; i++) {
      disp(fact(c[i]));
    }
    return 0;
  }
  
  double fact(int n) {
    double f;
    if (n == 1 || n == 0)
      f = (double) 1;
    else
      f = (double) n * fact(n - 1);
    return f;
  }
  
  void disp(double t) {
    printf("%f\n", t);
  }
  </code></pre>