find a number whether it is even or odd without using any
control structures and relational operators?
Answer Posted / shashi
#include<stdio.h>
main()
{
int n;
string s[2]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",s[n]);
}
| Is This Answer Correct ? | 11 Yes | 2 No |
Post New Answer View All Answers
What is difference between main and void main?
What is echo in c programming?
what is the syallabus of computer science students in group- 1?
WRITE A CODE IN C TO SEARCH A FILE FROM NOTEPAD FILE.
What is a c token and types of c tokens?
What is a good way to implement complex numbers in c?
Explain pointers in c programming?
What does *p++ do? What does it point to?
Describe dynamic data structure in c programming language?
What is linear search?
What are the different types of data structures in c?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What is the scope of an external variable in c?
Is r written in c?
What is a lookup table in c?