Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
58c6b1f81c
commit
cfe502c598
1277 changed files with 48709 additions and 1 deletions
14
hw6/oatprograms/fact.oat
Normal file
14
hw6/oatprograms/fact.oat
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
int fact(int x) {
|
||||
var acc = 1;
|
||||
while (x > 0) {
|
||||
acc = acc * x;
|
||||
x = x - 1;
|
||||
}
|
||||
return acc;
|
||||
}
|
||||
|
||||
int program(int argc, string[] argv) {
|
||||
print_string(string_of_int(fact(5)));
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue