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 importance of c in your views?
I need previous papers of CSC.......plz help out by posting them.......
How do I determine whether a character is numeric, alphabetic, and so on?
What is c value paradox explain?
Can a local variable be volatile in c?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
In a byte, what is the maximum decimal number that you can accommodate?
where are auto variables stored? What are the characteristics of an auto variable?
What is a char c?
Write a program to print “hello world” without using semicolon?
What is #ifdef ? What is its application?
What is a constant and types of constants in c?
What is a pointer and how it is initialized?
What is uint8 in c?
Which is better between malloc and calloc?