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 does *p++ do?
Why is c platform dependent?
I heard that you have to include stdio.h before calling printf. Why?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
How macro execution is faster than function ?
Explain indirection?
Why do we need functions in c?
What is the maximum length of an identifier?
can we have joblib in a proc ?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What is the use of putchar function?
Describe explain how arrays can be passed to a user defined function
What does the format %10.2 mean when included in a printf statement?
Is a pointer a kind of array?
What does %c mean in c?