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 is a pointer and how it is initialized?
What is the advantage of a random access file?
Why is void main used?
Why #include is used in c language?
What is the basic structure of c?
What are dangling pointers in c?
What is the difference between malloc() and calloc() function in c language?
How many levels of pointers can you have?
What are the types of data types and explain?
What are the modifiers available in c programming language?
What does nil mean in c?
What is array of pointers to string?
what is uses of .net
Explain what does the function toupper() do?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?