Assume that c is a char variable has been declared and already given a value. Write an expression whose value is true if and only if c is NOT what is called a whitespace character (that is a space or a tab or a newline– none of which result in ink being printed on paper).

3
Assume that c is a char variable has been declared and already given a value. Write an expression whose value is true if and only if c is NOT what is called a whitespace character (that is a space or a tab or a newline– none of which result in ink being printed on paper).

LANGUAGE: JAVA

CHALLENGE:

Assume that c is a char variable has been declared and already given a value. Write an expression whose value is true if and only if c is NOT what is called a whitespace character (that is a space or a tab or a newline– none of which result in ink being printed on paper).

SOLUTION:

!(c == ' ' || c== '\n' || c == '\t')

3 comments

Add comment