find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / vamsi
#include<stdio.h>
main()
{
int n;
string p[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",p[n]);
}
| Is This Answer Correct ? | 13 Yes | 8 No |
Post New Answer View All Answers
How can I remove the leading spaces from a string?
What is array in c with example?
What's a good way to check for "close enough" floating-point equality?
How do you print only part of a string?
Does c have an equivalent to pascals with statement?
What do you understand by friend-functions? How are they used?
In C programming, what command or code can be used to determine if a number of odd or even?
What are the benefits of organizational structure?
Explain the difference between exit() and _exit() function?
What is the use of in c?
What is an lvalue?
Explain what is wrong with this statement? Myname = ?robin?;
Is there sort function in c?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What are the 4 types of unions?