summaryrefslogtreecommitdiff
path: root/testapp/docs/fact.c
diff options
context:
space:
mode:
Diffstat (limited to 'testapp/docs/fact.c')
-rw-r--r--testapp/docs/fact.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/testapp/docs/fact.c b/testapp/docs/fact.c
new file mode 100644
index 0000000..e3665f5
--- /dev/null
+++ b/testapp/docs/fact.c
@@ -0,0 +1,10 @@
+int factorial(int a)
+{
+ int i,fact=1;
+ for(i=1;i<=a;a--)
+ {
+ fact=fact*a;
+ }
+ return fact;
+
+}