find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / vinocit
#include<stdio.h>
int main()
{
int n=10000;
char *s[2]={"Even","Odd"};
printf("%s",s[n&1]);
return 0;
}
| Is This Answer Correct ? | 47 Yes | 11 No |
Post New Answer View All Answers
What is the difference between far and near in c?
What is assert and when would I use it?
What are c preprocessors?
Does c have an equivalent to pascals with statement?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
Write a progarm to find the length of string using switch case?
What is the -> in c?
What is void main ()?
Explain how do you use a pointer to a function?
What is the purpose of 'register' keyword in c language?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
Why is c so powerful?
What is the role of && operator in a program code?
What are extern variables in c?
What is the purpose of ftell?