How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)
Answer Posted / anandi
void main()
{
int n;
char s[20][20]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
What is data type long in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
What are extern variables in c?
What is the sizeof () operator?
Can we compile a program without main() function?
What is return type in c?
int i=3; this declaration tells the C compiler to a) reserve space in memory to hold the integer value b) associate the name i with this memory location c) store the value 3 at this location d) all the above
Write a program of prime number using recursion.
What is difference between static and global variable in c?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What are the 4 data types?
What does *p++ do? What does it point to?
Differentiate between a structure and a union.
Why do we write return 0 in c?