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
Explain modulus operator.
Can you subtract pointers from each other? Why would you?
What is huge pointer in c?
What are the features of the c language?
Explain what are the different file extensions involved when programming in c?
How can I run c program?
in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.
What are pointers in C? Give an example where to illustrate their significance.
The statement, int(*x[]) () what does in indicate?
Which is more efficient, a switch statement or an if else chain?
When do we get logical errors?
Do you know pointer in c?
Can we compile a program without main() function?
What is #include conio h?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above