Practice free →
HomeNDA › Reasoning & Aptitude › The function $f(x) = |x|$ can be expressed piece…

The function $f(x) = |x|$ can be expressed piecewise as:

A$f(x) = x$ for all $x$
B$f(x) = x$ if $x \ge 0$; $f(x) = -x$ if $x < 0$
C$f(x) = -x$ for all $x$
D$f(x) = x^{2}$
Answer & Solution
Correct answer: B. $f(x) = x$ if $x \ge 0$; $f(x) = -x$ if $x < 0$
The modulus function returns the non-negative part. For $x \ge 0$, $|x| = x$. For $x < 0$, $|x| = -x$ (flipping the sign makes it positive).
Solve this in the app — NDA practice & 24k+ MCQs →
Related questions