Function Declaration
Overview
A function declaration introduces the function to the program, specifying its name, return type, and parameters without including the function body. This is different from the function definition, which also includes the function’s logic (body). Function declarations are typically used in languages where the compiler needs to know about a function before it's called in the code.
Syntax
C++
// Function declaration (without body)
return_type function_name(parameter1_type parameter1, parameter2_type parameter2);
Video Explanation

Example
C++ Example
// Declaration
int add(int a, int b);
// Definition
int add(int a, int b) {
return a + b;
}
Syntax
Python
// Python does not separate function declarations from function definitions. The function is defined and declared in one step.
// Function definition (Python inherently defines and declares in one step)
def function_name(parameter1, parameter2):
# function body
Video Explanation

Example
Python Example
// In Python, declaration and definition occur together
def add(a, b):
return a + b