Skip to main content

Nassi-Shneiderman Diagram

The Nassi-Shneiderman diagram uses specific symbols to represent different control structures and program elements:

SymbolInterpretationDescription
ExpressionExpression BlockRepresents a single statement or expression
DoWhileDo While BlockRepresents code once, then repeats while condition is true
ForFor BlockRepresents code for a specified number of iterations
IfElseIf Else BlockRepresents one of two code paths based on a condition
IfElseIfIf-ElseIf BlockRepresents code based on multiple sequential conditions
SwitchSwitch BlockRepresents code based on matching case values
WhileWhile BlockRepeats code while condition is true
TryTry-Catch BlockHandles code execution and error cases

Each symbol aligns with its interpretation:

  • Expression blocks represent non-decisional, non-iterative, or any other expressions.
  • Do While, While, and For blocks repeat code with conditions at the top or bottom.
  • If Else and If ElseIf blocks show side-by-side branches based on conditions.
  • Switch blocks split horizontally for each case.
  • Try Catch Finally blocks split horizontally for each block.