Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

If/Else

Part of TutorialFundamentals

Description

Simple (yet effective) flow control.

Example

import std.stdio;

void main() {
  int i;
  if (i == 0)
    writef("It's one!");
  else
    writef("It's not one!");
}