How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array)
Answer Posted / vaishu
void main()
{
int n;
char s[]={"even","odd"};
printf("Enter the no.:");
scanf("%d",&n);
n=n%2;
printf("th no. is %s",s[n]);
getch();
}
| Is This Answer Correct ? | 12 Yes | 7 No |
Post New Answer View All Answers
What is time null in c?
Can a pointer be static?
I have a varargs function which accepts a float parameter?
Explain a pre-processor and its advantages.
What are the 4 types of unions?
How will you divide two numbers in a MACRO?
What is pointer in c?
What is data structure in c language?
What are structure members?
What is dangling pointer in c?
Define the scope of static variables.
What is difference between structure and union in c programming?
What are the keywords in c?
can we implement multi-threads in c.
Is a pointer a kind of array?