Home

thenbranch

Thenbranch is the portion of a conditional statement that is executed when the evaluated condition is true. It represents the "positive" outcome in a decision flow and is paired with an else-branch, which handles the alternate path when the condition is false. The term is descriptive rather than a formal keyword in many languages, but it helps describe the structure of conditional constructs across families of programming languages.

Syntax varies. Some languages explicitly label the block with then, such as Pascal and Ada: if condition

Single-line conditionals sometimes use a compact form where the thenbranch corresponds to the expression executed if

Beyond programming, the concept appears in formal logic as the consequent of implication (if p then q)

then
begin
...
end;.
In
languages
without
an
explicit
then,
the
language
still
defines
a
true-branch
that
runs
when
the
condition
holds,
typically
enclosed
by
braces
or
indentation
(for
example,
C,
Java,
Python).
the
condition
is
true,
followed
by
an
else-expression.
The
thenbranch
can
be
a
single
statement
or
a
block
of
statements,
and
it
may
be
nested
within
other
conditional
constructs
to
implement
complex
decision
logic.
and
in
decision
modeling
as
the
path
taken
when
a
predicate
is
satisfied.
Terminology
varies
by
domain;
some
sources
refer
to
the
"true
branch"
or
"positive
branch"
instead
of
thenbranch.
Understanding
the
thenbranch
aids
in
reading
and
constructing
conditional
statements,
control
flow,
and
decision
trees.