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 do I get a null pointer in my programs?
Write a program in c to replace any vowel in a string with z?
What is anagram in c?
How do you do dynamic memory allocation in C applications?
What is main () in c language?
An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode
What is a pointer variable in c language?
Write a program to know whether the input number is an armstrong number.
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
What the different types of arrays in c?
i want to know the procedure of qualcomm for getting a job through offcampus
Explain how do you generate random numbers in c?
What do you mean by keywords in c?
What are the types of type specifiers?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321