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

Answer Posted / mukul garg

main()
{
int num;
clrscr();
printf("enter the number");
scanf("%d",&num);
(num%2==0)?printf("even num"):printf("odd num");
}

Is This Answer Correct ?    13 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are reserved words?

658


Can you define which header file to include at compile time?

591


Why does the call char scanf work?

622


How do I copy files?

625


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

663






Can we add pointers together?

622


differentiate built-in functions and user – defined functions.

634


Is there a way to compare two structure variables?

617


What is 1d array in c?

602


Is a house a mass structure?

644


When should the register modifier be used? Does it really help?

620


How are strings stored in c?

598


Explain what header files do I need in order to define the standard library functions I use?

649


What is a string?

668


What is null character in c?

695