/* Recursiv.c */
/* A simple example of recursion. */
/* By Macneil Shonle */

#include <stdio.h>  /* necessary for stream I/O */

/* function prototype */
void PrintHello(int How_Many_Times);

/* main function */
int main()
{
 int n;

 printf("How many times do you want to print the message? ");
 scanf("%d", &n);
 PrintHello(n);

 return 0;
}

/* recursive function */
void PrintHello(int How_Many_Times)
{
 printf("Recursive function begins with the parameter value %d.\n",
    How_Many_Times);
 if(How_Many_Times > 0)   /* If How_Many_Times is greater than zero, */
  {                       /* make another recursive call. */
   printf("Hello\n");
   PrintHello(How_Many_Times - 1); /* Reduce How_Many_Times by one. */
  }
 printf("Recursive function with parameter value %d ends.\n", How_Many_Times);
}
