Write a program to find given number is even or odd without
using any control statement.

Answer Posted / rani

#include<stdio.h>
#include<conio.h>
void main()
{
char str[][10]={"even","odd"};
int no;
clrscr();
printf("\nEnter a number...");
scanf("%d",&no);
printf("\n%d is %s",no,str[no%2]);
getch();
}

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How arrays can be passed to a user defined function

587


Can a file other than a .h file be included with #include?

692


What is a stream water?

666


Can static variables be declared in a header file?

630


What is static and volatile in c?

794






Can a variable be both const and volatile?

684


Is it possible to pass an entire structure to functions?

567


why return type of main is not necessary in linux

1714


How do I copy files?

631


Is the exit() function same as the return statement? Explain.

674


Which is an example of a structural homology?

804


What are register variables? What are the advantage of using register variables?

698


What is a constant and types of constants in c?

610


List the difference between a 'copy constructor' and a 'assignment operator' in C?

649


What is a class c rental property?

628