Variable & Constant
Variable
§A variable is nothing but a name given to a storage area
that our programs can manipulate. Each variable in C has a specific data type, which determines the size of the
variable's memory.
§A variable is an entity that does change.
Numeric Variableà Used to stores either integer values or character values.
Character Variableà Used to stores Alphabet or ASCII values.
§A variable cannot be type void.
int a 10
*Here int is a data type of variable a whose constant value is 10
Constant
§A constant is an identifier whose value doesn't change during execution
of program.
§Numeric Integer
§Integerà Sequence of
digits //23 , 102 , 154 etc…
§Real à A floating point type
or fractional values. // 3.7 , 6.45 ,
34.65 etc…
Character Integer
§Singleà ‘a’
‘d’ ‘g’ ‘C’ etc….
§Stringà “samir”
“Uddin”
§Declaring Constant
§Count float pi=3.14
No comments:
Post a Comment