Functions are blocks of code that perform a specific task and can be called multiple times within a program.
#includevoid greet() { printf("Hello, World!\n"); } int main() { greet(); // Calling the function return 0; }
This program defines a function greet
that prints "Hello, World!" and calls it in the main
function.