How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)
Answer Posted / ligory antony
void main()
{
int n;
char *s[4]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}
| Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
What functions are used in dynamic memory allocation in c?
What do you mean by recursion in c?
What is the scope of local variable in c?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
What is meant by type casting?
Explain what is dynamic data structure?
How many loops are there in c?
Explain how can I remove the trailing spaces from a string?
Is it possible to have a function as a parameter in another function?
Do pointers take up memory?
Explain pointers in c programming?
Why use int main instead of void main?
write a c program in such a way that if we enter the today date the output should be next day's date.
Explain goto?
What does a pointer variable always consist of?