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
What is %d used for?
Explain how can you restore a redirected standard stream?
List out few of the applications that make use of Multilinked Structures?
What are the advantages and disadvantages of pointers?
Explain function?
What is the use of sizeof?
What is return in c programming?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
How can I find the modification date and time of a file?
show how link list can be used to repersent the following polynomial i) 5x+2
Place the #include statement must be written in the program?
What are the restrictions of a modulus operator?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
Do you know null pointer?
Difference between linking and loading?