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
Explain can static variables be declared in a header file?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What is void main () in c?
What is a global variable in c?
What is derived datatype in c?
Explain what is wrong in this statement?
What is the use of extern in c?
Explain how does flowchart help in writing a program?
what is a function method?give example?
How to implement a packet in C
Function calling procedures? and their differences? Why should one go for Call by Reference?
Write a program to print "hello world" without using a semicolon?
What is #include conio h?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
How can I automatically locate a programs configuration files in the same directory as the executable?