Write a Pseudocode function that returns the factorial of an integer input.

--------------------------------------INPUT XY = 1
WHILE ( X > 1) Y = X * Y X = X - 1
OUTPUT Y-------------------------------It is also possible to complete this task using recursion
DEF fact(n):  IF (n > 1):    RETURN (n*fact(n-1))  ELSE    RETURN 1

Related Computing A Level answers

All answers ▸

Write pseudocode for the binary search algorithm and state, with an explanation, it's worst case complexity in big-O notation


Explain a bubble sort. You may use pseudocode and/or diagrams to help demonstrate your answer.


Choose 3 types of malware, describe them and the ways in which they may harm a device.


Explain what is meant by the term ‘TCP/IP stack’ [3]