C Function with no arguments and no return value

In C, function can have no arguments and no return value. Such type of function cannot accept any input and cannot return any value.

void is used as function return type, to not return any value.

Function Declaration Syntax

<return_type> <function_name>();

Function Definition Syntax

<return_type> <function_name>()
{
   // set of statements
}

Function call Syntax

<function_name>();

Example

#include<stdio.h>

//Function Declaration
void addNumbers();

void main()
{
   addNumbers(); //Function call
}
// //Function Definition
void addNumbers()
{
   int a = 20, b = 30, c = 0;
   c =  a + b;
   printf("Sum is %d ", c);
}