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

Answer Posted / naveen

main ()
{
int num;
if ( num & 1 )
printf ("num is odd number\n");
else
printf ("num is even number\n");
}

Is This Answer Correct ?    21 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between text files and binary files?

980


Do you know what are the properties of union in c?

811


Explain how can a program be made to print the name of a source file where an error occurs?

963


Explain what is gets() function?

831


What is extern storage class in c?

732


How to declare pointer variables?

924


What the advantages of using Unions?

941


What is structure in c language?

851


Do you know the purpose of 'register' keyword?

841


Are enumerations really portable?

815


what is stack , heap ,code segment,and data segment

2463


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

879


What does it mean when a pointer is used in an if statement?

877


Is fortran still used today?

823


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1217