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 %s and %d in c?
Should a function contain a return statement if it does not return a value?
Is null valid for pointers to functions?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
What are c preprocessors?
What is structure of c program?
What are the two types of structure?
What are the different types of errors?
What is the symbol indicated the c-preprocessor?
When is a null pointer used?
How the c program is executed?
When a c file is executed there are many files that are automatically opened what are they files?
How do you determine a file’s attributes?
Differentiate between a for loop and a while loop? What are it uses?
Is it possible to have a function as a parameter in another function?