Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How do you determine whether to use a stream function or a low-level function?

1122


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1078


What is the use of #define preprocessor in c?

1074


How the c program is executed?

1149


Do you know the purpose of 'register' keyword?

1019


Explain the difference between exit() and _exit() function?

1167


How can I sort more data than will fit in memory?

1102


Is it better to bitshift a value than to multiply by 2?

1092


What are loops in c?

995


What is difference between class and structure?

1114


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

1238


What does 3 mean in texting?

1093


Is c dynamically typed?

1151


Write a program to find the biggest number of three numbers in c?

1041


What are c preprocessors?

1185