Computer scienceAlgorithms and data structuresIntro to algorithms and data structuresPseudocode and representation

Pseudocode basics

Decoding a simple pseudocode function

Report a typo

Consider the following pseudocode:


FUNCTION CalculateArea(length, width)
  IF length <= 0 OR width <= 0 THEN
    RETURN 'Invalid input'
  ELSE
    RETURN length * width
  ENDIF
END FUNCTION
What is correct about this pseudocode function?
Select one or more options from the list

Create a free account to access the full topic