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 is the difference between text and binary modes?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Is fortran still used in 2018?
What is the meaning of typedef struct in c?
What is the difference between #include and #include 'file' ?
What will be the outcome of the following conditional statement if the value of variable s is 10?
What do you mean by keywords in c?
How can I get the current date or time of day in a c program?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What are enumerated types?
What is the difference between typedef struct and struct?
What is the function of multilevel pointer in c?
Explain about block scope in c?
What is main () in c language?
Difference between MAC vs. IP Addressing