find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / gganesh
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter the number : ");
scanf("%d",&n);
n%2?printf("Odd"):printf("Even");
getch();
}
note: here i used conditional operator, not a relational
operators and control structures
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
How can I rethow can I return a sequence of random numbers which dont repeat at all?
why we wont use '&' sing in aceesing the string using scanf
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
what is a function method?give example?
Differentiate between full, complete & perfect binary trees.
Sir i need notes for structure,functions,pointers in c language can you help me please
What is static memory allocation? Explain
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is a stream water?
What is indirection?
What is an example of structure?
What is the difference between printf and scanf )?
What are the different types of C instructions?
How many types of operator or there in c?
Can we replace the struct function in tree syntax with a union?