To find whether a number is even or odd without using any
conditional operator??
Answer Posted / mohd adnan
/* By Mohd Adnan MCA(2007-10) IMS Ghaziabad */
/* by using bit wise operator*/
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
printf("Enter any number:");
scanf("%d",%num);
(num&1)&&printf("Odd Number");
((num&1)==0)&&printf("Even Number");
getch();
}
Is This Answer Correct ? | 37 Yes | 15 No |
Post New Answer View All Answers
How can I trap or ignore keyboard interrupts like control-c?
What are the 5 types of inheritance in c ++?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
List some of the dynamic data structures in C?
Explain how can you restore a redirected standard stream?
Should a function contain a return statement if it does not return a value?
Why c is a procedural language?
What is an endless loop?
What does void main return?
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
difference between Low, Middle, High Level languages in c ?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What are the different types of errors?
What is the best style for code layout in c?
Define macros.