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
What is wrong with this code?
What are header files in c programming?
How can I write a function analogous to scanf?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What should malloc() do?
What is #include stdio h and #include conio h?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
what is the difference between 123 and 0123 in c?
What is a node in c?
Write a program to identify if a given binary tree is balanced or not.
Subtract Two Number Without Using Subtraction Operator
Explain what is the difference between #include and #include 'file' ?
What are the types of pointers in c?
Does c have class?
What functions are used in dynamic memory allocation in c?