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
provide an example of the Group by clause, when would you use this clause
What is the process to generate random numbers in c programming language?
What is the size of empty structure in c?
Explain which function in c can be used to append a string to another string?
Write a program on swapping (100, 50)
What is a structure member in c?
Explain what is the concatenation operator?
What are the 4 types of functions?
List the difference between a "copy constructor" and a "assignment operator"?
How many types of arrays are there in c?
Why static is used in c?
Why void main is used in c?
What is the purpose of 'register' keyword?
What is strcpy() function?
What is meant by type casting?