# Odd and Even Number Using Function in C

Jun 27, 2022
``` A simple program that I wrote to ask the user to give any number and then the program will check if the given number is an odd and even number using functions and bitwise operator in C programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My mobile number here in the Philippines is 09173084360.

=================================================

Want to support my channel?

GCash Account

09173084360

Paypal

Patreon

Thank you very much for your support.
```
``````/* odd_even_number.c
Bacolod City, Negros Occidental
*/

#include <stdio.h>

/**
* Function to check even or odd
* Returns 1 is num is even otherwise 0
* if odd number. Using bitwise operator
*  in a function to check for odd and even
*  numbers
*/
int isEven_Number(int num)
{
return !(num & 1);
}

int main()
{
int val_num=0;

printf("\n\n");
printf("\tOdd and Even Number Using Function in C\n");
printf("\n");
printf("\tGive any number: ");
scanf("%d", &val_num);

printf("\n\n");

if(isEven_Number(val_num))
{
printf("\tThe given number %d is even number.",val_num);
}
else
{
printf("\tThe given number %d is odd number.",val_num);
}
printf("\n\n");
printf("\tEnd of Program");
printf("\n");
return 0;

}``````