VOOZH about

URL: https://www.geeksforgeeks.org/lisp/when-construct-in-lisp/

⇱ When Construct in LISP - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

When Construct in LISP

Last Updated : 9 Nov, 2021

In this article, we will discuss the when construct. The when is a decision-making statement used to specify the decisions. It is similar to conditional statements.

Syntax:

(when (condition) (statements) )

where,

  1. condition is a test statement used to test
  2. statements are the actions that will depend on the condition

Example 1: LISP Program to check the number is equal to 50 or not

Output:

Equal to 50

Example 2: LISP Program to check the given number with comparison operators

Output:

Equal to 50
greater than or Equal to 50
less than or Equal to 50
Comment