Program Elements: Program is a set of instructions.Every Program consists,
- Identity of a program is unique.
- Programs, Classes, Variables and Methods having identities
- Identities are used to access these members.
- Variable is an identity given to memory location.
- Variable is also Called “Named Memory Location”
- Variables are used to store information of program(class/object)
|datatype identity = value;||int age = 23; |
double salary = 35000.00;
char gender = ‘M’;
char* name = “Amar”;
- Function is a block of instructions with an identity
- Function performs operations on data(variables)
- Function takes input data, perform operations on data and returns results.
|returntype identity(arguments) |
|int add(int a, int b) |
int c = a+b;