find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / om

void odd_even_check(int z)
{
(z&1)?printf("\nodd\n"):printf("\neven\n");
}

Is This Answer Correct ?    1 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?

813


Which is better oop or procedural?

634


What is an operator?

656


Explain what is the difference between a string and an array?

640


What are the advantages and disadvantages of a heap?

713






Why is extern used in c?

612


What is the use of structure padding in c?

563


How do shell structures work?

569


Why is %d used in c?

567


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1469


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2740


What are the scope of static variables?

601


What is preprocessor with example?

587


What are multidimensional arrays?

656


Explain how do you view the path?

655