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


Please Help Members By Posting Answers For Below Questions

What are predefined functions in c?

568


What are the key features in c programming language?

617


What are loops in c?

551


FILE PROGRAMMING

1779


What is the use of bit field?

644






explain what is an endless loop?

611


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

2008


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

615


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

559


What is the benefit of using an enum rather than a #define constant?

661


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

632


Is printf a keyword?

762


What is scope and lifetime of a variable in c?

578


What are local static variables?

619


Why functions are used in c?

587