Bifalgorithm post · Computer science one · If, If-Else, If-Else-If Statements

What do character comparison results show in C?

What do character comparison results show in C? (Computer science one · If, If-Else, If-Else-If Statements) — "16. Conditionals Comparison Example Result ('A'…

Ideas in this flowchart

  • Character comparisons in C can produce unexpected results.
  • The code can be written and will compile.
  • The code will also run.
  • However, the results will not be as expected.
  • Table 16.4 presents examples of character comparisons in C.
  • 'A' < 'a' is true.
  • 'A' == 'a' is false.
  • 'A' < 'Z' is true.
  • '0' < '9' is true.
  • '\n' < 'A' is true.
  • ' ' < '\n' is false.
Feed/

What do character comparison results show in C?

No cover

Channel

Computer science one

1 page

"16. Conditionals Comparison Example Result ('A' < 'a') true ('A' == 'a') false ('A' < 'Z') true ('0' < '9') true ('\n\n' < 'A') true (' ' < '\n\n') false Table 16.4.: Character comparisons in C. Understand that you can write this code, it will compile, and it will even run. However, the results will not be as expected."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.