Constants an types of Constants in C programming language

Constants

Constant is a quantity whose value cannot be changed during program execution.

The different types of Constants which are supported in c language are:

1. Integer Constants
2. Floating Constants
3. Character Constants
4. enumeration Constants

1. Integer Constants
          Represents a signed integer of typically 2 or 4 or 8 bytes (16 or 32 or 64 bits) Precise size is machine-dependent. It is a number that has an integer value. It can be specified in decimal, octal or hexadecimal form.

2. Floating Constants
          Floating constant have matissa and exponent part.Mantissa(significant part) contains digit followed by decimal point(.)and then digit.

Ex: 123.6549554

3. Character Constants
          It is grouped into two categories: integer character, wide character integer character is a sequence of one or more character enclosed in single quotes ‘ a’. The character within the single quote may be any character.

Ex: 'a' 'b'


Some special characters are not visible directly in the output stream. These all begin with an escape character.
They are:
       1. \n newline
       2. \t horizontal tab
       3. \a alert bell
       4. \v vertical tab
Constants an types of Constants in C programming language Constants an types of Constants in C programming language Reviewed by Unknown on 08:01 Rating: 5

No comments:

Powered by Blogger.