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,i;
printf("Enter any Number : \n");
scanf("%d",&num);
i=num&1;
if(i==1)
{
printf("ODD");
}
else
{
printf("EVEN");
}
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How can I find out how much free space is available on disk?
Explain how do you view the path?
Are local variables initialized to zero by default in c?
What are lookup tables in c?
In which language linux is written?
The statement, int(*x[]) () what does in indicate?
How can I read a binary data file properly?
Should I learn c before c++?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Why is c fast?
What is mean by data types in c?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
How do you print only part of a string?
please explain every phase in the "SDLC" in the dotnet.
Explain what standard functions are available to manipulate strings?