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

What is wrong with this code?

1125


What are header files in c programming?

1071


How can I write a function analogous to scanf?

1093


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1798


What should malloc() do?

1096


What is #include stdio h and #include conio h?

1035


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

978


what is the difference between 123 and 0123 in c?

1152


What is a node in c?

912


Write a program to identify if a given binary tree is balanced or not.

1088


Subtract Two Number Without Using Subtraction Operator

777


Explain what is the difference between #include and #include 'file' ?

963


What are the types of pointers in c?

969


Does c have class?

1048


What functions are used in dynamic memory allocation in c?

1014