Which of the following assignment statements is correct?

a. char c = 'd';
b. char c = 100;
c. char c = "d";
d. char c = "100";

ab Choice (B) is also correct, because an int value can be implicitly cast into a char variable. The Unicode of the character is the int value. In this case, the character is d (see Appendix B).

Computer Science & Information Technology

You might also like to view...

A function key or key combination, such as F5 or Ctrl + R, that carries out a menu command is called a ________

A) shortcut key B) dongle C) click key D) macro

Computer Science & Information Technology

Which of the following pointing devices is the most similar to a mouse?

A. touchpad B. touchscreen C. game controller D. trackball

Computer Science & Information Technology