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

What is calloc() function?

615


What is the purpose of & in scanf?

586


How do we print only part of a string in c?

579


Write a program of advanced Fibonacci series.

700


What is function prototype in c language?

606






There seem to be a few missing operators ..

609


Explain heap and queue.

575


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1579


Why we use break in c?

539


Differentiate between static and dynamic modeling.

609


Can we increase size of array in c?

531


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

569


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

714


What are the 4 types of functions?

561


write a program to find the given number is prime or not

3824