Function with no argument & no return value in C Program | Coding classpoint

Function with no argument & no return value


In the program, we have function named fun1 which has no argument and no return type ( void is the return type - that means, function will not return anything).

Within the function fun1 we are declaring an array, calculating sum of its elements and printing the sum.

Syntax:

void function(void); 

 main() 

 {

 void function() 

 {

 Statement;

 } 

 Example:

 void me(); 

 main() 

 { 

 me();

 printf(“in main”); 

 } 

 void me() 

 {

 printf(“come on”); 

 } 

Output: 

come on 

 inn main


Tags

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.