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 #include preprocessor?
What is switch in c?
What is wrong with this initialization?
What library is sizeof in c?
Why doesnt the call scanf work?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
Do you know null pointer?
What are the 4 types of unions?
What is the symbol indicated the c-preprocessor?
What are the two types of structure?
What is the purpose of macro in C language?
What is %d called in c?
What type of function is main ()?
What are near, far and huge pointers?
why programs in c are running with out #include