= If/Else = ''Part of'' TutorialFundamentals == Description == Simple (yet effective) flow control. == Example == {{{ #!d import std.stdio; void main() { int anInteger; if (anInteger == 0) writef("It's zero!"); else writef("It's not zero!"); } }}} == Output == {{{ It's zero! }}} == More Information == In D, all variable declarations that do not have a specific initializer get initialized with the value of their type's .init property. In this case, anInteger is of type '''int''', and is assigned the value of '''int.init''', which is zero. To find out the initializer for other types, you may use the write function like so: {{{ #!d import std.stdio; void main() { writeln(int.init); writeln(float.init); } }}} == Output == {{{ 0 nan }}} For more information about '''.init''' and other properties, refer to the [http://www.digitalmars.com/d/2.0/property.html Properties documentation].