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
What is array of structure in c programming?
What is the difference between text files and binary files?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
How can I pad a string to a known length?
Are there namespaces in c?
Can one function call another?
can we have joblib in a proc ?
Why double pointer is used in c?
Who developed c language and when?
How do you use a 'Local Block'?
how to write optimum code to divide a 50 digit number with a 25 digit number??
Explain c preprocessor?
What is a pointer and how it is initialized?
what type of questions arrive in interview over c programming?
What are the uses of null pointers?