find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / abhradeep chatterjee
ya. the first answer has impressed me.
#include<stdio.h>
main()
{
int n;
string p[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is difference between structure and union with example?
Can the “if” function be used in comparing strings?
What is the difference between array and pointer?
How can you return multiple values from a function?
What is a newline escape sequence?
What are the different types of endless loops?
How do you construct an increment statement or decrement statement in C?
Explain what are linked list?
how do you programme Carrier Sense Multiple Access
How can I find the modification date of a file?
What is the meaning of && in c?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
Explain how can you tell whether a program was compiled using c versus c++?
Explain a pre-processor and its advantages.
What does do in c?