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...

To find whether a number is even or odd without using any
conditional operator??

Answer Posted / kala

main()
{
int n;
printf("enter the number\n");
scanf("%d",&n);
if(n%2==0){
printf("number is even");}
else{
printf("number is odd");
}
}
or
if(n&1==0)
printf("even number");
else
printf(odd number");

Is This Answer Correct ?    31 Yes 38 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1877


Can one function call another?

1061


Explain what does the format %10.2 mean when included in a printf statement?

1309


Do you know pointer in c?

1004


What do you mean by scope of a variable in c?

983


Explain the ternary tree?

977


How do shell structures work?

1081


What are the 4 types of unions?

1003


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

1007


What does sizeof int return?

1034


How do I get a null pointer in my programs?

1070


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

1005


show how link list can be used to repersent the following polynomial i) 5x+2

2210


When the macros gets expanded?

1357


What is the equivalent code of the following statement in WHILE LOOP format?

1261