QP School

Full Version: Function arguments and return values in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Functions can take arguments as input and return values as output.

int square(int num) {
    return num * num;
}

int result = square(5);
printf("Result: %d\n", result); // Output: 25