write a c program to print a given number as odd or even
without using loop statements,(no if ,while etc)

Answer Posted / dheerendra

logic
main()
{
int a;
(a%2==0)?printf("even"):printf("odd")
}

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is array of structure in c programming?

1017


Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.

2089


What type is sizeof?

801


Why use int main instead of void main?

856


What is main () in c?

787


What is a constant?

820


Explain how does flowchart help in writing a program?

874


how to execute a program using if else condition and the output should enter number and the number is odd only...

1938


What is the use of gets and puts?

778


What are the types of type qualifiers in c?

846


Can two or more operators such as and be combined in a single line of program code?

1122


an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational

1080


When c language was developed?

833


What is the difference between array and pointer?

780


What are the Advantages of using macro

907