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
How to implement a packet in C
What is the process to generate random numbers in c programming language?
How can I do serial ("comm") port I/O?
all c language question
Why do we use namespace feature?
What are the different types of endless loops?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Why is c fast?
What are the 4 types of unions?
What is f'n in math?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
What are extern variables in c?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Difference between pass by reference and pass by value?
What are the 4 types of organizational structures?