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
How arrays can be passed to a user defined function
Can a file other than a .h file be included with #include?
What is a stream water?
Can static variables be declared in a header file?
What is static and volatile in c?
Can a variable be both const and volatile?
Is it possible to pass an entire structure to functions?
why return type of main is not necessary in linux
How do I copy files?
Is the exit() function same as the return statement? Explain.
Which is an example of a structural homology?
What are register variables? What are the advantage of using register variables?
What is a constant and types of constants in c?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is a class c rental property?