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

Answer Posted / sahithya

void main()
{
int n;
printf("enter n:");
scanf("%d",&n);
if(n%2==0)
printf( "even");
else
printf("odd");
}

Is This Answer Correct ?    15 Yes 34 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is double pointer in c?

593


What is data structure in c and its types?

598


List the difference between a "copy constructor" and a "assignment operator"?

587


‎How to define structures? · ‎

636


What are categories used for in c?

573






What do you mean by a sequential access file?

631


What is the importance of c in your views?

599


what are bit fields? What is the use of bit fields in a structure declaration?

1502


What is the difference between int main and void main in c?

595


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

688


Can you please explain the difference between malloc() and calloc() function?

623


how could explain about job profile

1458


What is union and structure?

576


What are the features of c languages?

633


How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?

598