How to find even or odd number in C Language

Program to use even or odd number in C Language


#include <stdio.h>
int main()
{
    int num;
    printf("enter a number : ");
    scanf("%d", &num);
    if (num % 2 == 0)
    {
        printf("number is even\n");
    }
    else
    {
        printf("number is odd\n");
        num *= 2;
        printf("now the number is %d\n", num);
    }
    return 0;
}

output


enter a number : 13
number is odd
now  the number is 26

How to use a number even or odd in c language

program to use a number even or odd in c language


#include<stdio.h>
int main()
{
    int num;
    printf("Enter a number : ");
    scanf("%d",&num);
    if(num%2 == 0)
    printf("Number is even\n");
    else
    {
        printf("Number is odd\n");
        num*=2;
        printf("Now the number is %d\n",num);

    }
    return 0;
}

output


Enter a number : 24
Number is even

program to use a number even or odd is c longuage


#include<stdio.h>
int main()
{
    int num;
    printf("Enter a number : ");
    scanf("%d",&num);
    if(num%2 == 0)
    printf("Number is even\n");
    else
    {
        printf("Number is odd\n");
        num*=2;
        printf("Now the number is %d\n",num);

    }
    return 0;
}

output


Enter a number : 13
Number is odd
Now the number is 26