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
Can variables be declared anywhere in c?
what is ur strangth & weekness
What is assert and when would I use it?
Write a factorial program using C.
What is meant by recursion?
What are header files and what are its uses in C programming?
What is a lookup table in c?
What is variable initialization and why is it important?
What is the condition that is applied with ?: Operator?
Is null equal to 0 in sql?
What is structure in c definition?
What is the difference between if else and switchstatement
Who invented bcpl language?
What is the time and space complexities of merge sort and when is it preferred over quick sort?
What is the symbol indicated the c-preprocessor?