int and char

The char keyword declares a character variable. Variables of type char are 1 byte in length. They can be signed or unsigned, which means they have a range of -128 to 127 and 0 to 255, respectively.  For example:

char alphabet;

Variables of type int are one machine-type word in length. They can be signed (default) or unsigned, which means that in this configuration of the compiler they have by default a range of -32768 to 32767 and 0 to 65535 respectively

 

int a, b, c;                       // ‘a’, ‘b’, ‘c’ are integer variables

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s