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 are the advantages of using linked list for tree construction?

639


What is array of structure in c?

590


What is indirection? How many levels of pointers can you have?

650


How can a process change an environment variable in its caller?

648


Is null a keyword in c?

728






Are the variables argc and argv are always local to main?

568


How to compare array with pointer in c?

615


How are 16- and 32-bit numbers stored?

718


Why is c still so popular?

611


What does != Mean in c?

582


How do you use a 'Local Block'?

714


What is the scope of static variable in c?

524


What are the advantages of using Unions?

642


What is f'n in math?

612


Do pointers need to be initialized?

556