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
What are the different types of pointers used in c language?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Explain the binary height balanced tree?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
Which of these functions is safer to use : fgets(), gets()? Why?
What are the general description for loop statement and available loop types in c?
When should a type cast not be used?
What is the difference between procedural and declarative language?
How is null defined in c?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
What are Macros? What are its advantages and disadvantages?
Explain b+ tree?
What is the most efficient way to count the number of bits which are set in an integer?
What is character constants?
Are the outer parentheses in return statements really optional?