Constant in c language and constant definitions | constant in computer
Constant in c language and constant
In this post you will know what is Constant.,Constant in c language and constant definitions | constant in computer,string,real,numeric and etc.
Constant in c language and constant definitions |
Constant definitions
Constant is in refer to fixed value that do
not change during the execution of the program.
There are two types of constant
- Numeric constant
- Non numeric constant
Numeric constant
There are two types of numeric constant
- Integer constant
- Real constant
Integer constant
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
Read this:
Read this:
- मोबाइल से पैसे कैसे कमाए इन हिंदी
- Mpl se paise Kaise kamaye | mpl से पैसे कैसे कमाये
Hexadecimal integer constant
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
- Character constant
- 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)
Read this:-
Read this:-
String constant
They are sequence of character digit aur any symbol
closed double quote.
Example
“ Hello” “ &ab”
Variable
A 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
Also, read these articles
So in today's post you have learned what are the constants and what are the types of constants, what is the value of ASCII you have learned all this in today's post, I hope you liked our article if you If you get help, then you must share this with your friend.
Thanks for visiting on
Coding knowledge.in
No comments: