how to declare function in c

To declare a function in C, you need to specify the return type, the function name, and the parameter list (if any). Here is the syntax for declaring a function in C:

return_type function_name(parameter_list);

For example, if you want to declare a function named "add" that takes two integers as parameters and returns an integer, you can do it like this:

int add(int a, int b);

This declares a function named "add" that takes two integer parameters (a and b) and returns an integer value.

If the function doesn't have any parameters, you can leave the parameter list empty, like this:

void print_hello();

This declares a function named "print_hello" that doesn't take any parameters and doesn't return a value. The return type "void" is used to indicate that the function doesn't return anything.

Remember that declaring a function is different from defining a function. Declaration is just a way of telling the compiler about the existence of a function, while definition provides the actual implementation of the function.