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
- Numeric constant
- Non numeric constant
There are two types of numeric constant
- Integer constant
- Real 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.
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.
04,244 , -0244
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.
There are number with fraction part. This is also non age floating point constant.
Non numeric constant
There are two types of non numeric constant
- Character constant
- String constant
There are enclosed in single quote. This constant single character or digit.
Note:- character have integer value . known as ASCII
(American standard code for information interchange)
They are sequence of character digit aur any symbol closed double quote.
“ Hello” “ &ab”
A variable is named location in memory that is used to hold value that can be modified in the program by the instructions.
Float c, d
Also, Read these articles
- c language introduction
- C language character set definition
- c language tokens best notes in easy language
- C language keywords and their types
- print your name using c program in turb0 c++
- how to use youtube in desktop version in android
So in today’s post you have learned what are the Constant in c language 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.
You can get more large information about tokens and incoming new articles. Let’s follow our blog and support us.
if you have any queries or questions regarding this article you can ask in the comment section. we will reply to you as soon as possible.