This blog is under construction

Monday 24 June 2013

C program to illustrate function with no arguments and no return value

Write a C program to illustrate function with no argument and no return value.


  #include <stdio.h>

  /* function with no argument and no return value */
  void funWithNoArg() {
        printf("Function with no argument and no return value\n");
  }

  int main() {
        int i = 0;

        /* calls function funWithNoArg() 5 times */
        while (i <= 5) {
                funWithNoArg();
                i++;
        }
        return 0;
  }



  Output:
  jp@jp-VirtualBox:~/$ ./a.out
  Function with no argument and no return value
  Function with no argument and no return value
  Function with no argument and no return value
  Function with no argument and no return value
  Function with no argument and no return value
  Function with no argument and no return value



No comments:

Post a Comment