summaryrefslogtreecommitdiff
path: root/testapp/docs/fact.cpp
blob: f9b74587026ccb81ba821734ebd9e04014866692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
int fact = 1;
int factorial(int a)
{
  printf("%d\n",a);
  if(a<1)
  {
    printf("\nfinal");
    return 1;
  }
  else
  {
    printf("count\n");
    return a*factorial(a-1);
  }
}