find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / vishal jain
#include<stdio.h>
#include<conio.h>
int main()
{
int num;
printf("Enter any Number : \n");
scanf("%d",&num);
char *s[2]={"Even","Odd"};
printf("%s",s[num&1]);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
When the macros gets expanded?
Why structure is used in c?
How a string is stored in c?
What is nested structure with example?
about c language
how can I convert a string to a number?
State the difference between realloc and free.
What is a wrapper function in c?
Explain what is the purpose of "extern" keyword in a function declaration?
Do you have any idea about the use of "auto" keyword?
Is register a keyword in c?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Is malloc memset faster than calloc?
Explain what are binary trees?
Why c is procedure oriented?