Which data type is used to represent a single character in C?
a) int
b) float
c) char
d) double
Answer:
c) char
Explanation:
The char
data type in C is used to represent a single character. It typically occupies 1 byte of memory and can hold any character from the ASCII character set. The char
type is essential for handling individual characters and for working with strings in C, which are arrays of char
types.
Understanding the char
data type is fundamental for text processing and string manipulation in C programming.