Ask Question

What data type can be used to hold any single character, including numbers and non-printing characters?

+5
Answers (2)
  1. 13 February, 10:20
    0
    char

    Explanation:

    The character data type written as char holds any single character, numbers and non-printing characters. In java and most programming languages, the value of the character must be placed within single quotes. for example

    char c = 'd'

    char c = '9'

    char c = '/t'

    Are all valid declarations of a variable c as char and assigned d, then 9 and then used with a non-printing character (tab) with the escape sequence.
  2. 13 February, 10:21
    0
    char

    Explanation:

    In Java and some other programming languages, the data type used to hold a single character including numbers and non-printing characters is char.

    Examples of single characters (numbers) that can be held by a char data type are;

    (i) 065 - which represent an ASCII code for character 'A' (without quotes)

    (ii) 097 which represent an ASCII code for character 'a' (without quotes)

    Examples of single characters (non-printing) that can be held by a char data type are;

    (i) Non-breaking space

    (ii) Tab character

    Examples of other single characters that can be held by a char data type are;

    (i) 'd' - character d (without quotes)

    (ii) 'M' - character m (without quotes)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What data type can be used to hold any single character, including numbers and non-printing characters? ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers