find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / sanju uthaiah
#include<stdio.h>
int main()
{
char result[2]={"Even","Odd"};
int n=40;
printf("%d is %s",n,result[n%2]);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How does placing some code lines between the comment symbol help in debugging the code?
explain what are actual arguments?
What is the difference between near, far and huge pointers?
Explain how are portions of a program disabled in demo versions?
Is javascript written in c?
What are the different types of control structures in programming?
What is this infamous null pointer, anyway?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Why is structure important for a child?
Can you pass an entire structure to functions?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
When should structures be passed by values or by references?
What are pragmas and what are they good for?