Back To C User Defined Functions Index
//program to create a function that checks whether a number is even or odd (number is passed to function as argument) #include
#include
void evenodd(int); //function declaration void evenodd(int a) //function definition { if(a%2==0) { printf("number is even\n"); } else { printf("number is odd\n"); } } void main() { clrscr(); evenodd(10); //calling or invoking the function evenodd(15); getch(); }