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;
printf("Enter any Number : \n");
scanf("%d",&num);
char *s[2]={"Even","Odd"};
printf("%s",s[num&1]);
return 0;
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What are linker error?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is a loop?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
What are runtime error?
What is an lvalue?
How variables are declared in c?
how to construct a simulator keeping the logical boolean gates in c
Can we initialize extern variable in c?
Lists the benefits of c programming language?
Why we use conio h in c?
What is null pointer in c?
What is function pointer c?
in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above