In C programming, a function that does not take any arguments and does not return a value is called a void function. The syntax for defining a void function is as follows:
Syntax:
return_type function_name ( parameter1, parameter2, ... )
{
// body of Statement ;
}
Example :
void function_name ( )
{
// body of Statement ;
}
function_name ( );
Here is an example of a void function that prints a message to the console:
//No Return Without Argument Function in C /* 1.Function Declaration 2.Function Definition 3.Function Calling */ #include<stdio.h> //Function Declaration void add(); int main() { //Function Calling add(); return 0; } //Function Definition void add() { int a,b,c; printf("\nEnter The Value of A & B :"); scanf("%d%d",&a,&b); c=a+b; printf("\nTotal : %d",c); }To download raw file Click Here
Enter The Value of A & B :12 34 Total : 46
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions