It used to define the member functions of a class outside
1. Keyword
Definition:
A keyword is a reserved word in C language that has a predefined meaning. Keywords cannot be used as names of variables, functions or identifiers.
Examples of Keywords:int, float, if, else, while, return
Example:
int a = 10;
2. Constant
Definition:
A constant is a value that does not change during the execution of a program.
Types of Constants:
Integer constant
Floating constant
Character constant
Example:
#define PI 3.14
3. Identifier
Definition:
An identifier is the name given to a variable, function or array in a program.
Rules for Identifiers:
Must start with a letter or underscore
Should not be a keyword
Example:
int totalMarks;
4. Variable
Definition:
A variable is a memory location used to store data whose value can change during program execution.
Example:
int age = 20;
5. Operator
Definition:
An operator is a symbol used to perform operations on operands.
Types of Operators:
Arithmetic, Relational, Logical
Example:
c = a + b;
6. Assignment Operator
Definition:
Assignment operators are used to assign values to variables.
Common Assignment Operators:=, +=, -=, *=, /=
Example:
a += 5;
7. Function
Definition:
A function is a block of code that performs a specific task and can be reused many times.
Advantages:
Code reusability
Easy debugging
Example:
int add(int a, int b)
{
Return a + b;
}
8. Recursion
Definition:
Recursion is a process in which a function calls itself until a specific condition is met.
Applications:
Factorial, Fibonacci series
Example:
int fact(int n)
{
If(n == 0)
Return 1;
Else
Return n * fact(n-1);
}
9. Pointer
Definition:
A pointer is a variable that stores the memory address of another variable.
Advantages:
Efficient memory management
Faster program execution
Example:
int a = 10;
Int *p = &a;
10. Array
Definition:
An array is a collection of elements of the same data type stored in contiguous memory locations.
Example:
int a[5] = {1, 2, 3, 4, 5};
11. Push Function
Definition:
Push operation is used to insert an element into a stack. The new element is added at the top of the stack.
Example:
top++;
Stack[top] = value;
12. Linear Search
Definition:
Linear search is a simple searching technique in which elements are checked one by one until the required element is found.
Used For:
Small data sets
Example:
for(i = 0; i < n; i++)
{
If(a[i] == key)
Printf("Element Found");
}
English with a size of 4.24 KB