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 does main () mean in c?
Write a program to identify if a given binary tree is balanced or not.
what do u mean by Direct access files? then can u explain about Direct Access Files?
How can I find out how much free space is available on disk?
Why do we use static in c?
What is a program flowchart and explain how does it help in writing a program?
What is modifier & how many types of modifiers available in c?
What the different types of arrays in c?
What is c variable?
please give me some tips for the placement in the TCS.
How does #define work?
What is meant by int main ()?
What is size of union in c?
Explain what does the format %10.2 mean when included in a printf statement?
What is signed and unsigned?