C Function with no arguments and no return value

C Function with no arguments and no return value

  1. #include<stdio.h>

  2. void print_line();

  3. void main()
  4. {
  5.      print_line();
  6.     
  7.      printf("Hello World\n");
  8.     
  9.      print_line();
  10. }
  11. //void in the function indicates no return value. 
  12. void print_line() 
  13. {
  14.      printf("------------\n");

Output

Hello World

choose next program from this list

Comments