We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4cb0f8 commit 92100e3Copy full SHA for 92100e3
alan/programs/factorial.alan
@@ -13,10 +13,14 @@ factorial () : proc
13
else return n * factorial (n - 1);
14
}
15
16
+ n : int;
17
f : int;
18
{
- f = factorial(7);
19
- writeString("The factorial of 7 is ");
+ n = readInteger();
20
+ f = factorial(n);
21
+ writeString("The factorial of ");
22
+ writeInteger(n);
23
+ writeString(" is ");
24
writeInteger(f);
25
writeString("\n");
26
alan/programs/factorial.input
@@ -0,0 +1 @@
1
+7
0 commit comments