find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / rohit agarwal
#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 ? | 1 Yes | 2 No |
Post New Answer View All Answers
what is the basis for selection of arrays or pointers as data structure in a program
hi, which software companys will take,if d candidate's % is jst 55%?
What is function pointer c?
What is a struct c#?
What is the scope of global variable in c?
When we use void main and int main?
What is signed and unsigned?
What does it mean when a pointer is used in an if statement?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What will be the outcome of the following conditional statement if the value of variable s is 10?
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
How do you use a pointer to a function?
What is pre-emptive data structure and explain it with example?
What is the difference between arrays and pointers?
Is c dynamically typed?