To find whether a number is even or odd without using any
conditional operator??
Answer Posted / kala
main()
{
int n;
printf("enter the number\n");
scanf("%d",&n);
if(n%2==0){
printf("number is even");}
else{
printf("number is odd");
}
}
or
if(n&1==0)
printf("even number");
else
printf(odd number");
| Is This Answer Correct ? | 31 Yes | 38 No |
Post New Answer View All Answers
hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..
Can one function call another?
Explain what does the format %10.2 mean when included in a printf statement?
Do you know pointer in c?
What do you mean by scope of a variable in c?
Explain the ternary tree?
How do shell structures work?
What are the 4 types of unions?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
What does sizeof int return?
How do I get a null pointer in my programs?
How can I write a function that takes a format string and a variable number of arguments?
show how link list can be used to repersent the following polynomial i) 5x+2
When the macros gets expanded?
What is the equivalent code of the following statement in WHILE LOOP format?