Sunday, October 2, 2016

C function with no arguments and no return value.


//C Function with no arguments and no return value.

#include<stdio.h>

void print_line();

void main()
{
     print_line();
    
     printf("Hello World\n");
    
     print_line();
}
//void in the function indicates no return value. 
void print_line() 
{
     printf("------------\n");
}


Output of the programs:

------------
Hello World
------------

No comments:

Post a Comment