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

How is pointer initialized in c?

787


Can we compile a program without main() function?

877


What are Macros? What are its advantages and disadvantages?

863


What are keywords c?

799


Can include files be nested?

835


How do you convert strings to numbers in C?

929


What does the characters “r” and “w” mean when writing programs that will make use of files?

1181


Is it fine to write void main () or main () in c?

743


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

915


Explain what is the difference between text files and binary files?

865


Explain the advantages of using macro in c language?

764


What does malloc () calloc () realloc () free () do?

782


Why c is called a middle level language?

829


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2278


What is a scope resolution operator in c?

957