What is the char type in C?

char is a data type in C used to store a single character.

How many bytes does a char type typically use?

A char type typically uses 1 byte (8 bits).

What is the range of values that can be stored in a char type?

The range of values for a signed char is usually from -128 to 127, and for an unsigned char, it is from 0 to 255.

How do you declare a char variable in C?

char c;

How do you initialize a char variable with a character?

char c = 'A';

How can you represent a char as an integer?

By casting or using the int type, e.g., int num = (int) 'A'; or int num = 'A';

What is the ASCII value of the character 'A'?

The ASCII value of 'A' is 65.

How can you print a char in C using printf?

printf("%c", c);

How do you store a string in C using char?

By using an array of char, e.g., char str[] = "Hello";

What is the null character in C, and what is its purpose?

The null character '\0' is used to terminate strings in C.

How do you compare two char values in C?

Using comparison operators, e.g., if (char1 == char2) { ... }

What library function can be used to convert a char to an uppercase letter?

toupper(char) from <ctype.h>

How can you read a char from the user in C?

Using scanf, e.g., scanf("%c", &c);

What is the difference between signed and unsigned char?

A signed char can store negative values, while an unsigned char can only store non-negative values.

How do you convert a char representing a digit to its corresponding integer value?

Subtract '0' from the char, e.g., int num = c - '0'; where c is a char between '0' and '9'.