| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Turing Reference - Conditional Statement

Page history last edited by Steve Sweeney 10 years, 3 months ago

A conditional statement, or simply condition, is a comparison that must be either TRUE or FALSE.

 

Rules:

  1. Each conditional statement compares two values of the same data type - these may be integers (int), decimals (real), or combinations of characters (string).
  2. A comparison operator must be used between each pair of values.
  3. Multiple comparisons are possible using the logical operators, also called the boolean operators.

 

Format:

 

     <value1>  <comparison operator>  <value2>

 

Sample Code:

 

var a : int

var b: int

put "What is a? "..

get a

put "What is b?"..

get b

 

if a = b then

   put "a and b are the same"

else

   put "a and b are not the same"

end if

 

 

Comments (0)

You don't have permission to comment on this page.