functions

C Functions

C Functions

Functions are blocks of code that perform a specific task and can be called multiple times within a program.

Creating a Function

#include 

void 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.