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) { cout<<"number is even\n"; } else { cout<<"number is odd\n"; } } void main() { clrscr(); evenodd(10); //calling or invoking the function evenodd(15); getch(); }