To find whether a number is even or odd without using any
conditional operator??

Answer Posted / umair jatoi && zain ja

/* ZAIN JATOI AND UMAIR JATOI */
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n;
printf("Enter any number:");
scanf("%d",&n);
if(n&1)
printf("%d is Odd number",n);
else
printf("%d is even number",n);
getch();
}

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is javascript written in c?

571


Are pointers integer?

543


Why do some versions of toupper act strangely if given an upper-case letter?

627


How can I access an I o board directly?

619


Explain zero based addressing.

601






why return type of main is not necessary in linux

1697


How pointers are declared?

556


What is meant by keywords in c?

610


What is preprocessor with example?

578


What is the c language function prototype?

642


Explain how do you search data in a data file using random access method?

689


Define the scope of static variables.

597


What is pointer to pointer in c with example?

543


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2225


Without Computer networks, Computers will be half the use. Comment.

1865