find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / ramesh
#include<stdio.h>
#include<conio.h>
main()
{
int n;
char *p[]={"Even","odd"};
clrscr();
printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
getch();
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is pointers in c?
What is #ifdef ? What is its application?
Why do we use null pointer?
What is #include conio h?
How to delete a node from linked list w/o using collectons?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
List some basic data types in c?
What is the size of structure in c?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
Which are low level languages?
Explain how can you avoid including a header more than once?
What is meant by operator precedence?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
Explain modulus operator. What are the restrictions of a modulus operator?
c program to compute AREA under integral