10+ C Odd-Even Program Examples

This post contains a total of 10+ Hand-Picked C Odd-Even Checker Program Examples with Source Code. All the Odd-Even Checker programs are made using C Programming Language.

You can use the source code of these programs for educational purpose with credits to the original owner.

Related Posts

Click a Code to Copy it.

1. By sayali desai

Made by sayali desai. C Odd even checker made without using conditional statement. ( Source )

Enter no 12 ....even
#include <stdio.h>

int main() {
    int n;
    printf("Enter no....");
    scanf("%d",&n);
 ((n%2)&&printf("odd"))||printf("even");

    return 0;

}

2. By Baraa AB

Made by Baraa AB. Just a simple Odd-Even checker. ( Source )

Enter a no: 33 
odd
#include<stdio.h>
int main()
{
    int no;
    printf("Enter a no: ");
    scanf("%d", &no);
    (no & 1 && printf("odd"))|| printf("even");
    return 0;
}

3. By S U M A N

Made by S U M A N. Enter only positive numbers. ( Source )

55
55 is odd number

//enter any positive number 

#include <stdio.h>
int main() {
int a,b;
scanf("%d",&a);
b=a;
while(a>1)
{
a-=2;   
}
printf("%d is %s",b,(a==0)? "even number":"odd number");
    return 0;
}

4. By ✳AsterisK✳

Made by ✳AsterisK✳. Separate odd and even array element. ( Source )

***************************
even array: 2 4 6 8 10 
odd array: 1 3 5 7 9 
***************************
#include <stdio.h>

int main(){
    int arr[10] = {1,2,3,4,5,6,7,8,9,10};
    int arr2[21] = {67,114,101,97,116,101,100,32,98,121,32,42,65,115,116,101,114,105,115,75,42};
    int even[6],odd[6];
    int i,con=0,con1=0;
    for(i=0;i<10;i++){
        if(arr[i]%2 == 0){
            even[con++] = arr[i];
        }else{
            odd[con1++] = arr[i];
        }
    }
    printf("***************************\n");
    printf("even array: ");
    for(i=0;i<con;i++){
        printf("%d ",even[i]);
    }
    printf("\n");
    printf("odd array: ");
    for(i=0;i<con1;i++){
        printf("%d ",odd[i]);
    }
    printf("\n***************************");
    printf("\n");
    for(i=0;i<21;i++){
        printf("%c",arr2[i]);
    }
}

5. By Varadhan E

Made by Varadhan E. ( Source )

35
Reminds = 1 so the number is
odd
#include <stdio.h>

int main() {
int i;
scanf("%d",&i);
int j=i%2;
printf ("Reminds = %d so the number is\n",j);

if(j==0)

    printf ("even");

else 
    printf ("odd");

    return 0;;
}

6. By Nithya Yamasinghe

Made by Nithya Yamasinghe. ( Source )

Enter the number: 44
44 is an even number
#include <stdio.h>

// function main begins program execution
int main() {
    
    int number; // number to be entered by the user
    
    printf("Enter the number:\n"); // prompt the number
    scanf("%d", &number); // read the number
    
    if(number % 2 == 0) // checking the number
        printf("%d is an even number\n", number); // print the number
    
    else
        printf("%d is an odd number\n", number); // print the number
        
        
    
    
	return 0;
} // function main ends

7. By Yamin Mansuri

Made by Yamin Mansuri. Even Odd number checker using while loop. ( Source )

Enter how many number : 13


0 is even
1 is odd
2 is even
3 is odd
4 is even
5 is odd
6 is even
7 is odd
8 is even
9 is odd
10 is even
11 is odd
12 is even
13 is odd
#include <stdio.h>

int main() {

    int n, i=0, r;
    
    printf("Enter how many number : ");
    
    scanf("%d",&n);
    
    printf("%d\n\n\n",n);
    
    while(i<=n)
    {
        r=i%2;
        
        if(r==0){
            
            printf("%d is even\n",i);
        }
        
        else printf("%d is odd\n",i);
        i++;
    }
    
    return 0;
}

8. By ✨SARANG✨

Made by ✨SARANG✨. ( Source )

16
16 is a even number
#include <stdio.h>
int main() 
{
int x;
scanf("%d",&x);

if((x%2==0 && x!=0))
printf("%d is a even number",x);

if((x%2==1 && x!=0))
printf("%d is a odd number",x);

if((x%-2==-1 && x!=0))
printf("%d is a odd number",x);

if((x==0))
printf("0 is neither odd nor a even number");

   return 0;
}

9. By Shivam Mishra

Made by Shivam Mishra. C program to check even and odd number without using % operator. ( Source )

enter a number
57
odd number
#include<stdio.h>
int main()
{
    int a;
    printf("enter a number");
    scanf("%d",&a);
  if(a&1)
    {
        printf ("\nodd number");
    }
else{
printf("\neven number");
}
return(0);
}

10. By Deepti Dixit

Made by Deepti Dixit. ( Source )

Enter the value: 23
 your value is :23
This is odd number
#include <stdio.h>

int main() {


int var;

printf("Enter the value:\n",var);

scanf("%d",&var);



if(var%2==0)

{
    
    printf("your value is :%d \n This is even number",var);
}
  else{
      
      printf(" your value is :%d\nThis is odd number",var);
  }
  
  
    return 0;
}

11. By Yamin Mansuri

Made by Yamin Mansuri. Check odd or even of n number. ( Source )

Enter any number 
Entered Number = 33
33 is Odd number
#include <stdio.h>

int main() {

    int n, lastdigit;
    
    printf("Enter any number \n");
    scanf("%d",&n);
    printf("Entered Number = %d\n",n);
    lastdigit = n%10;
    
    if(lastdigit % 2 == 0){
        printf("%d is Even number\n",n);
    }
    else{
        printf("%d is Odd number",n);
    }
    return 0;
}