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 / vishal jain

#include<stdio.h>
#include<conio.h>
int main()
{
int num,i;
printf("Enter any Number : \n");
scanf("%d",&num);
i=num&1;
if(i==1)
{
printf("ODD");
}
else
{
printf("EVEN");
}
return 0;
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I write a function that takes a format string and a variable number of arguments?

1053


Can a variable be both constant and volatile?

1112


Why is %d used in c?

1005


When should a far pointer be used?

1119


what is bit rate & baud rate? plz give wave forms

1976


Explain what’s a signal? Explain what do I use signals for?

1150


What do you mean by invalid pointer arithmetic?

1071


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2689


Explain what does the function toupper() do?

1071


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


How can I implement a delay, or time a users response, with sub-second resolution?

1072


What does typeof return in c?

1090


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1074


Write a program in c to replace any vowel in a string with z?

1123


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1269