this is my code, when even i run it it tells me that the number is even while it is odd.

#include<stdio.h>
#include<stdlib.h>
int main(void)
{
    int value;

    /* To read a number and say wheither it is even or odd*/
    printf("Please enter any number \n");
    scanf("%u", &value);


    if (value/2 != 0)
        printf("the number is Even \n");
        else 
            printf("the number is Odd \n ");
    printf("The value is %u \n",value*10);

    return 0;
}

please help me out in getting the code to work in the right way that i want it to.

You need to use the mod % operator instead of division to find out if it's odd or even

if( Value%2 == 0)
{
   // even
 }
 else
 {
    // odd
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.