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
Why is it usually a bad idea to use gets()? Suggest a workaround.
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Write a simple code fragment that will check if a number is positive or negative.
What is 02d in c?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
What is volatile c?
What is d scanf?
can any one provide me the notes of data structure for ignou cs-62 paper
How do you declare a variable that will hold string values?
Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;
What is the method to save data in stack data structure type?
Calculate 1*2*3*____*n using recursive function??
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
What is NULL pointer?