summaryrefslogtreecommitdiff
path: root/testapp/docs/fact.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/docs/fact.cpp')
-rw-r--r--testapp/docs/fact.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/testapp/docs/fact.cpp b/testapp/docs/fact.cpp
new file mode 100644
index 0000000..f9b7458
--- /dev/null
+++ b/testapp/docs/fact.cpp
@@ -0,0 +1,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);
+ }
+}