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

Explain what are multibyte characters?

1203


In C language, a variable name cannot contain?

1279


How can variables be characterized?

2194


How many bytes is a struct in c?

1173


Write a simple code fragment that will check if a number is positive or negative.

1161


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

1035


Distinguish between actual and formal arguments.

1087


How do I get a null pointer in my programs?

1116


the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b

2681


Can include files be nested?

1118


What are examples of structures?

1116


How can you increase the size of a dynamically allocated array?

1193


general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only

1077


Explain Function Pointer?

1184


Who invented b language?

1421