find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / ruchi
#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 ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is a constant?
Explain how can I open a file so that other programs can update it at the same time?
Explain the use of fflush() function?
Define recursion in c.
What is the difference between union and structure in c?
what do u mean by Direct access files? then can u explain about Direct Access Files?
How to compare array with pointer in c?
What standard functions are available to manipulate strings?
Are c and c++ the same?
How reliable are floating-point comparisons?
What is static identifier?
Define macros.
Explain what math functions are available for integers? For floating point?
Explain what is the purpose of "extern" keyword in a function declaration?
I have seen function declarations that look like this