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
What is array of structure in c programming?
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What type is sizeof?
Why use int main instead of void main?
What is main () in c?
What is a constant?
Explain how does flowchart help in writing a program?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is the use of gets and puts?
What are the types of type qualifiers in c?
Can two or more operators such as and be combined in a single line of program code?
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
When c language was developed?
What is the difference between array and pointer?
What are the Advantages of using macro