WHAT IS VARIABLE?
Just like a container; that can help to store data with specific type.
Example: int,char,string,
* In 'C' Language to declare a variable should maintain following point---------
➡️ 1st character should be an alpha or underscore(_).
Ex: number,_number
➡️ Do not use any special character except under score(_)
Ex: student@name⛒
student+name⛒
student_name✓
➡️ May or may not sure numeric digits
Ex: 1no⛒
_1no✓
no1✓
n1o✓
➡️ Upper case and lower char are distinct
Ex: no✓
No✓
NO✓
nO✓
* How to declare a variable?
syn: <datatype> <variable name>;
Ex: int a;
float b;
Type of Variable:
1. int a; (signed short integer)
2. unsigned int b; (unsigned short integer)
3. long c; (signed long integer)
4. unsigned long d; (unsigned long integer)
5. float p; (single precision real variable )
6. double r;(double precision real variable)
7. long double s;(double precision real variable)
8. char n;(character variable )
9. char name[30];(string variable)
Just like a container; that can help to store data with specific type.
Example: int,char,string,
* In 'C' Language to declare a variable should maintain following point---------
➡️ 1st character should be an alpha or underscore(_).
Ex: number,_number
➡️ Do not use any special character except under score(_)
Ex: student@name⛒
student+name⛒
student_name✓
➡️ May or may not sure numeric digits
Ex: 1no⛒
_1no✓
no1✓
n1o✓
➡️ Upper case and lower char are distinct
Ex: no✓
No✓
NO✓
nO✓
* How to declare a variable?
syn: <datatype> <variable name>;
Ex: int a;
float b;
Type of Variable:
1. int a; (signed short integer)
2. unsigned int b; (unsigned short integer)
3. long c; (signed long integer)
4. unsigned long d; (unsigned long integer)
5. float p; (single precision real variable )
6. double r;(double precision real variable)
7. long double s;(double precision real variable)
8. char n;(character variable )
9. char name[30];(string variable)
0 Comments
Post a Comment