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 / mohd adnan

/* By Mohd Adnan MCA(2007-10) IMS Ghaziabad */
/* by using bit wise operator*/
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter any number:");
scanf("%d",%num);
(num&1)&&printf("Odd Number");
((num&1)==0)&&printf("Even Number");
getch();
}

Is This Answer Correct ?    37 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can the size of an array be declared at runtime?

1146


What are 'near' and 'far' pointers?

1093


What is the maximum length of an identifier?

1231


Is printf a keyword?

1260


When a c file is executed there are many files that are automatically opened what are they files?

1152


What is the use of typedef in c?

1083


What is the stack in c?

1228


Explain what happens if you free a pointer twice?

1138


what is the function of pragma directive in c?

1181


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1374


Write a program to print “hello world” without using semicolon?

1185


Are there any problems with performing mathematical operations on different variable types?

1106


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

1169


Can you please explain the difference between exit() and _exit() function?

1086


Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.

1294