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
Post a Comment