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
When should the register modifier be used? Does it really help?
What does & mean in scanf?
difference between native and cross compilers
What are the Advantages of using macro
Is printf a keyword?
What are the disadvantages of external storage class?
Explain continue keyword in c
What is ## preprocessor operator in c?
What is the basic structure of c?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
In which language linux is written?
What is the easiest sorting method to use?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
What are the different types of data structures in c?
How can you find the day of the week given the date?