find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / vinocit

#include<stdio.h>
int main()
{
int n=10000;
char *s[2]={"Even","Odd"};
printf("%s",s[n&1]);
return 0;
}

Is This Answer Correct ?    47 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

which of the following statement is wrong a) mes=123.56; b) con='T'*'A'; c) this='T'*20; d) 3+a=b;

2410


List the difference between a While & Do While loops?

640


How many types of functions are there in c?

586


What is the best organizational structure?

644


When is the “void” keyword used in a function?

840






What are near, far and huge pointers?

649


What is difference between structure and union in c programming?

571


What is c mainly used for?

600


What is the use of ?: Operator?

670


Explain setjmp()?

660


What math functions are available for integers? For floating point?

626


How can I delete a file?

631


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

686


‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.

1880


Which is the best website to learn c programming?

584