Write a program to find the given number is odd or even
without using any loops(if,for,do,while)

Answer Posted / taesung kim

(num & 1) ? (odd) : (even);

Is This Answer Correct ?    8 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is keyword in c?

595


How can I do serial ("comm") port I/O?

681


the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....

22192


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

575


What is data structure in c and its types?

588






What is the advantage of an array over individual variables?

731


Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"

1580


What is static volatile in c?

572


How can I change their mode to binary?

690


Which is more efficient, a switch statement or an if else chain?

573


Where static variables are stored in memory in c?

519


What are the advantages and disadvantages of a heap?

700


What are the storage classes in C?

619


Explain how can I right-justify a string?

618


How are pointers declared in c?

592