Problem 19: Odd or Even

Write a program which determines whether a number is ODD or EVEN.

2,329 total views, 4 views today

Comments

comments

5 thoughts on “Problem 19: Odd or Even”

  1. #include
    imt main()
    {
    int num;
    scanf(“%d”,&num);
    if(num%2==0)
    printf(“Number is Even”);
    else
    printf(“Number is Odd”);
    return (0);
    }

  2. #include
    int main()
    {
    int i;
    printf(“Enter a number\n”);
    scanf(“%d”,&i);
    if(i%2==0)
    printf(“Even\n”);
    else
    printf(“ODD\n”);
    return 0;
    }

  3. #include
    int main()
    {
    int number;
    printf(“Enter any number\n”);
    scanf(“%d”,&number);
    if(number%2==0){
    printf(“It is even number\n”);
    }
    else{
    printf(“It is odd\n”);
    }
    }

  4. #include
    int main()
    {
    int x;
    scanf(“%d”,&x);
    if(x%2==0 || x%5==0){
    printf(“The number is EVEN”);
    }else{
    printf(“The number is ODD”);
    }
    return 0;
    }

  5. #include

    int main()
    {
    int x;
    printf(“Please input a No: “);
    scanf(“%d”,&x);

    if(x%2==1){
    printf(“This is an ODD No.\n”);
    }else{
    printf(“This is a EVEN no.\n”);
    }

    return 0;

    }

Leave a Reply

Your email address will not be published.