How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)
Answer Posted / vaishu
void main()
{
int n;
char s[]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}
Is This Answer Correct ? | 12 Yes | 7 No |
Post New Answer View All Answers
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
Who is the main contributor in designing the c language after dennis ritchie?
Are c and c++ the same?
Why structure is used in c?
How can you find the exact size of a data type in c?
How can you read a directory in a C program?
Are bit fields portable?
ATM machine and railway reservation class/object diagram
In c programming language, how many parameters can be passed to a function ?
what is stack , heap ,code segment,and data segment
What are pointers? Why are they used?
How can I find out the size of a file, prior to reading it in?
How can I sort a linked list?
What do header files do?
What is data type long in c?