Google

Friday, January 15, 2010

CSC202 & ENG4033M : Functions

/*Modular Program*/
#include "stdio.h"
void sayHello(); //Function Prototype (Declaration)
int doubleIt(int n);

int main()
{
sayHello(); //Function Call
int n = doubleIt(2);
printf("result = %d\n",n);
return 0;
}

int doubleIt(int n)
{
return n*2;
}
void sayHello() //Function Definition
{
printf("Hello\n");
}