QP School

Full Version: Declaring and defining functions in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Functions are blocks of code that perform specific tasks. They need to be declared before using them.
// Function declaration
int add_numbers(int a, int b);

// Function definition
int add_numbers(int a, int b) {
    return a + b;
}