find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / asad
int oddeven(int n)
{
if(n&1)
return 1; //odd
else
return 0; //even
}
| Is This Answer Correct ? | 2 Yes | 7 No |
Post New Answer View All Answers
Are bit fields portable?
Under what circumstances does a name clash occur?
explain how do you use macro?
What is a double c?
Which type of language is c?
What are control structures? What are the different types?
What is modeling?
What does void main () mean?
Write a program to swap two numbers without using a temporary variable?
What is merge sort in c?
What is the collection of communication lines and routers called?
What is uint8 in c?
Explain what are the advantages and disadvantages of a heap?
Why main is not a keyword in c?
Explain what is a program flowchart and explain how does it help in writing a program?