find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / d.c.sathishkumar
#include<stdio.h>
main()
{
int n;
char *p[]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",a[n]);
}
| Is This Answer Correct ? | 17 Yes | 8 No |
Post New Answer View All Answers
What is the benefit of using #define to declare a constant?
Explain the difference between malloc() and calloc() function?
What is the use of function in c?
How can I find the modification date of a file?
What is difference between %d and %i in c?
Can a pointer be static?
What is a memory leak? How to avoid it?
What is the purpose of the preprocessor directive error?
write a program for the normal snake games find in most of the mobiles.
c language interview questions & answer
I have seen function declarations that look like this
What is the explanation for modular programming?
Which is more efficient, a switch statement or an if else chain?
Tell me what is null pointer in c?
Differentiate between static and dynamic modeling.