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

Answer Posted / avinash kumar

#include<stdio.h>
main()
{
int a;
clrscr();
printf("enter a number:");
scanf("%d",&a);
if(a%2=0)
printf("even");
else
printf("odd")
getch();
}

Is This Answer Correct ?    25 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of pointers used in c language?

610


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

734


Explain the binary height balanced tree?

719


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2330


Which of these functions is safer to use : fgets(), gets()? Why?

631






What are the general description for loop statement and available loop types in c?

685


When should a type cast not be used?

622


What is the difference between procedural and declarative language?

645


How is null defined in c?

650


How can I rethow can I return a sequence of random numbers which dont repeat at all?

700


What are Macros? What are its advantages and disadvantages?

641


Explain b+ tree?

618


What is the most efficient way to count the number of bits which are set in an integer?

587


What is character constants?

710


Are the outer parentheses in return statements really optional?

570