C program to check a given number is even or odd using function

C program to check a given number is even or odd using function

Write a C program to check whether a given number is even or odd using the function.


#include
int main()
{
?int num;
?printf("Enter any number: ");
?scanf("%d", &num);
?if(isEven(num))
?{
?printf("The number is even.");
?}
?else
?{
?printf("The number is odd.");
?}
?return 0;
}
int isEven(int num)
{
?return !(num & 1);
}