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
How can I get the current date or time of day in a c program?
How will you declare an array of three function pointers where each function receives two ints and returns a float?
How can I determine whether a machines byte order is big-endian or little-endian?
What is printf () in c?
Is fortran faster than c?
What is atoi and atof in c?
Explain how can a program be made to print the name of a source file where an error occurs?
Suggesting that there can be 62 seconds in a minute?
What is p in text message?
What is difference between scanf and gets?
#include
Explain what is the difference between null and nul?
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
What is the difference between array and structure in c?
Why do we use & in c?