Sunday, 13 August 2017

C program to check number is odd or even without using bitwise and module operator

-–-----–-----------
#include<stdio.h>
#include<conio.h>

Void main()
{
       int  number;

       printf("Enter a number :");

       scanf("%d",&number);

       if((n/2)*2==n)

        printf("Number is even");

       else

        printf("Number is odd");

       getch();
}

--–-----–------------

No comments:

Post a Comment