To find whether a number is even or odd without using any
conditional operator??

Answer Posted / rudrakshala leela phani kumar

int main()
{
int a[2][5]={"Even","Odd"};
int n;
printf("Enter Integet No:");
scanf("%d",&n);
printf("\nResult:%d",a[n%2]);
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the mean of function?

649


What is the use of typedef in structure in c?

546


Explain what are bus errors, memory faults, and core dumps?

792


What is merge sort in c?

644


Can a local variable be volatile in c?

575






Explain what is the concatenation operator?

628


What is the difference between fread and fwrite function?

640


Why #include is used in c language?

601


What is a program?

665


Explain the use of #pragma exit?

699


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

2190


Why isn't any of this standardized in c? Any real program has to do some of these things.

623


What are the 3 types of structures?

572


What are header files in c programming?

657


How can I find out how much free space is available on disk?

629