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
What functions are in conio h?
Explain the use of fflush() function?
How we can insert comments in a c program?
What does char * * argv mean in c?
How does sizeof know array size?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is a macro?
What are register variables? What are the advantage of using register variables?
Can you pass an entire structure to functions?
What is assignment operator?
What do you mean by a local block?
What are the restrictions of a modulus operator?
What is the general form of function in c?
What is C language ?
Can you explain the four storage classes in C?