find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / gganesh
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
clrscr();
printf("Enter the number : ");
scanf("%d",&n);
n%2?printf("Odd"):printf("Even");
getch();
}
note: here i used conditional operator, not a relational
operators and control structures
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Write a C program to count the number of email on text
In a switch statement, explain what will happen if a break statement is omitted?
What are pointers? Why are they used?
What is the easiest sorting method to use?
When should volatile modifier be used?
Can a file other than a .h file be included with #include?
What is the purpose of sprintf() function?
What are variables c?
What’s a signal? Explain what do I use signals for?
what are bit fields in c?
What is a far pointer in c?
Is c object oriented?
How do you determine a file’s attributes?
What is a pointer in c?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?