C code of if nested(switch inside switch) program check positive and negative number with odd or even

 #include<stdio.h>

int main()
{
    int num;
     printf("enter number:");
     scanf("%d",&num);
     
    if (num>=0)
    {
        printf("positiv number ");
       
        if (num % 2==0 )
            {
                printf("  and its  EVEN number ");
           
            }
        else
            {
                 printf("  and its ODD number ");
            }
    }

    else
    {
        printf("given number is NEGATIV ");

        if(num % 2==0)
        {
            printf("  and its EVEN number ");
        }
       
        else
        {
            printf("  and  its ODD number ");
        }

    }

     printf("\nthankyou ");

        return 0;

}

Comments

Popular posts from this blog

HERE IS ALL THE C CODE I CREATED

C sum all values output valus using for loop