How are character constants represented in the C language?

In C language, character constants can be enclosed in single quotes (‘) to represent characters. For example:

  1. Character ‘A’ represents the letter A.
  2. ‘9’: indicates the character 9
  3. ‘\n’ : represents a line break
  4. ‘\’ is used to represent a backslash.
  5. ” represents single quotation mark
  6. ” ” : indicate double quotation marks.
  7. ‘\t’ is used to indicate a tab character.
  8. ‘\0’ indicates a null character, which marks the end of a string.

It is important to note that character constants can only contain a single character. If you need to represent a string, you should use double quotation marks to enclose multiple characters, for example: “hello”.

bannerAds