find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / sanju uthaiah
#include<stdio.h>
int main()
{
char result[2]={"Even","Odd"};
int n=40;
printf("%d is %s",n,result[n%2]);
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain what is the difference between a string and an array?
What do you mean by dynamic memory allocation in c? What functions are used?
Can a variable be both static and volatile in c?
Tell us two differences between new () and malloc ()?
Write a program of prime number using recursion.
What are the salient features of c languages?
Write a program to reverse a string.
What is meant by recursion?
What is the ANSI C Standard?
How many loops are there in c?
If you know then define #pragma?
Apart from dennis ritchie who the other person who contributed in design of c language.
explain what is a newline escape sequence?
How can I split up a string into whitespace-separated fields?
What is dynamic dispatch in c++?