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
What is calloc() function?
What is the purpose of & in scanf?
How do we print only part of a string in c?
Write a program of advanced Fibonacci series.
What is function prototype in c language?
There seem to be a few missing operators ..
Explain heap and queue.
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
Why we use break in c?
Differentiate between static and dynamic modeling.
Can we increase size of array in c?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
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
What are the 4 types of functions?
write a program to find the given number is prime or not