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
What does int main () mean?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
Can I initialize unions?
Explain what are its uses in c programming?
Write a Program to find whether the given number or string is palindrome.
What are lookup tables in c?
Why do we use static in c?
How to write a code for reverse of string without using string functions?
Are global variables static in c?
Explain how do you view the path?
What is the use of the function in c?
Explain the concept and use of type void.
Tell us two differences between new () and malloc ()?
what is the function of pragma directive in c?
Why do we use & in c?