Difference between revisions of "2022 Paper 1 Revision Quiz"
Line 1: | Line 1: | ||
<quiz display=simple> | <quiz display=simple> | ||
− | |||
{In Recursion, the part of the code which runs itself is called? | {In Recursion, the part of the code which runs itself is called? | ||
|type="()"} | |type="()"} | ||
Line 22: | Line 21: | ||
- Recursive Case. | - Recursive Case. | ||
||Incorrect | ||Incorrect | ||
+ | |||
+ | <syntaxhighlight lang=c#> | ||
+ | public int Fact(int num) | ||
+ | { | ||
+ | if (num == 0) | ||
+ | return 1; | ||
+ | else | ||
+ | return num * Fact(num-1); | ||
+ | |||
+ | } | ||
+ | </syntaxhighlight> | ||
</quiz> | </quiz> |