[ANSYS, Inc. Logo] return to home search
next up previous contents index

A.11.1 if Statement

An if statement is a type of conditional control statement. The format of an if statement is:

 if (logical-expression)
     {statements}

where logical-expression is the condition to be tested, and statements are the lines of code that are to be executed if the condition is met.



Example


if (q != 1) 
     {a = 0; b = 1;}


next up previous contents index Previous: A.11 Control Statements
Up: A.11 Control Statements
Next: A.11.2 if-else Statement
Release 12.0 © ANSYS, Inc. 2009-01-14