# Constant in c language and constant definitions | constant in computer

Constant in c language:- In this post, you will know what is Constant., Constant in c language and constant definitions | constant in computer, string, real, numeric and etc.

if you want to learn about Constant in c language, we will provide you best notes. that I write in my notebook.

Hello, friends today in this post. I tell you about Constant in c language.

## what is constant in c language?

Constant is in refer to a fixed value that does not change during the execution of the program.

## types of constant in c language

There are two types of constant

1. Numeric constant
2. Non numeric constant

## Numeric constant

There are two types of numeric constant

1. Integer constant
2. Real constant

### integer constant

An integer constant is a value that is determined at compile time and cannot be changed at run time. An integer constant expression is an expression that is composed of constants and evaluated to a constant at compile time.

there are many integer constant in c language.

#### Decimal integer constant

There are a sequence of digit from 0 to 9 without fraction part. It may be negative, positive or zero.

Examples

12,499. 0, , -15,44

#### Octal integer constant

There are sequence of digit from 0 to 7 without fraction part. It may be negative, positive or zero. It must include  0 before the number.

Example

04,244 ,  -0244

There are sequence digit from 0 to 9 and A to F without fraction value. It may be negative, positive Or O  . It must include X.

Example

0x244, -0xA44

## Real constant

There are number with fraction part. This is also non age floating point constant.

Example

12.44

## Non numeric constant

There are two types of non numeric constant

1. Character constant
2. String constant

### character constant

There are enclosed in single quote. This constant single character or digit.

Example

‘9’ ‘n’

Note:- character have integer value . known as ASCII

(American standard code for information interchange)

### string constant

They are sequence of character digit aur any symbol closed double quote.

Example

“ Hello” “ &ab”

## Variable

variable is named location in memory that is used to hold value that can be modified in the program by the instructions.

Example

Int a,b

Float c, d