Example of Function in C

#include  "stdio.h"
#include  "conio.h"

//For Example as Simple Function
int Addition (int a,int b)
  {
   return a+b;
  }

//For Example of Recursion Function
//Use of Conditional Operator
int factorial(int a)
{
    return (a>0)?(a*factorial(a-1)):1;
}

//For Example of Pass By Reference
void swap(int *p,int *q)
{
int *r;
*r=*p;
*p=*q;
*q=*r;
}

void main()
{
int i=4,j=3;
clrscr();
printf("\nAddition = %d",Addition(i,j)); // Pass by value
printf("\nFactorial= %d",factorial(i));    // Recursion function
swap(&i,&j);                                             // Pass by reference
printf("\n After Swaping");
printf("\n I=%d  J=%d",i,j);
getch();
}