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


Please Help Members By Posting Answers For Below Questions

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?

981


What are linker error?

614


a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above

656


What is a loop?

555


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1518






What are runtime error?

629


What is an lvalue?

636


How variables are declared in c?

571


how to construct a simulator keeping the logical boolean gates in c

1730


Can we initialize extern variable in c?

632


Lists the benefits of c programming language?

598


Why we use conio h in c?

585


What is null pointer in c?

595


What is function pointer c?

586


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

635