DO NOT MISS

Ads

Saturday 25 June 2016

Identifiers & Variables



Identifiers:-
Identifiers refer to the name of variables, functions and arrays. These are user defined names & consist of a sequence of letters & digits. Both upper & lower case letters are commonly used. The underscore char is also permitted in identifiers.

Rules:-
1.  Spaces are not allowed.
2. They must begin with alphabet.
3. Uppercase & lower case letters are significant.


Variables:-
A variables is at data name that may be used to store a data value, unlike constants, that remain unsigned during the execution of the program, a variables may take different values of different times during exe.
(or)
The name given to the memory location for storing the values is called Variable. 
The values of the Variable can be changed during the program execution.

Syntax 1:- 
Data type variable name; 


Ex:- int a; 


Syntax 2:- 
Data type variable name 1,variable name 2,-----------variable name n; 

 Ex:- int a,b,c;

Rules for the Variable creation:-
1. The variable name is must be related to our program. 

2. In variable first letter must be a alphabet. 
3. The Variable name must be in Lower case. 
4. They should not spaces in Variable names. 
5. If you want to use space we can use underscore( _ ) operator. 
6. Key words are not used as Variable.

Variable name
a
b
c
d
e
Value
35
‘a’
8.75
-41
47.52145415
data type variable name;
int a,d;
char b;
float c;
double e;
__________________________________________________________________________________
__________________________________________________________________________________

Greataims

 
Copyright © 2016 Computersadda. Designed by @ Computersadda Team - Published By Greataims