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
c program to compute AREA under integral
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
How can I recover the file name given an open stream or file descriptor?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
#include
What is meant by gets in c?
Distinguish between actual and formal arguments.
Can the size of an array be declared at runtime?
What are the 4 types of organizational structures?
What are different types of operators?
What is typeof in c?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What is a dynamic array in c?
Explain what is meant by 'bit masking'?
Is c is a high level language?