Assume that x is a char variable that has been declared and already given a value. Write an expression whose value is true if and only if x is a decimal digit (0-9).

Assume that x is a char variable that has been declared and already given a value.  Write an expression whose value is true if and only if x is a decimal digit (0-9).

LANGUAGE: Visual Basic

CHALLENGE:

Assume that x is a char variable that has been declared and already given a value. Write an expression whose value is true if and only if x is a decimal digit (0-9).

SOLUTION:

(x >= "0") And (x <= "9")


Add comment