What does this expression mean?
f==0?1:f*fact(f-1)
Jump to PostThe expression
condition ? then_expression : else_expression
evaluates to the result ofthen_expression
ifcondition
evaluates totrue
and toelse_expression
otherwise.So the above expression evaluates to
1
iff
is0
and tof * fact(f-1)
otherwise.
The expression condition ? then_expression : else_expression
evaluates to the result of then_expression
if condition
evaluates to true
and to else_expression
otherwise.
So the above expression evaluates to 1
if f
is 0
and to f * fact(f-1)
otherwise.
Thanks.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.