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 are predefined functions in c?
What are the key features in c programming language?
What are loops in c?
FILE PROGRAMMING
What is the use of bit field?
explain what is an endless loop?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
What is the benefit of using an enum rather than a #define constant?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Is printf a keyword?
What is scope and lifetime of a variable in c?
What are local static variables?
Why functions are used in c?