07-25-2023, 11:02 AM
Function prototypes provide the compiler with information about the functions before their actual implementation.
// Function prototype
int add_numbers(int a, int b);
int main() {
int sum = add_numbers(10, 20);
printf("Sum: %d\n", sum);
return 0;
}
// Function definition
int add_numbers(int a, int b) {
return a + b;
}
// Function prototype
int add_numbers(int a, int b);
int main() {
int sum = add_numbers(10, 20);
printf("Sum: %d\n", sum);
return 0;
}
// Function definition
int add_numbers(int a, int b) {
return a + b;
}