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


Please Help Members By Posting Answers For Below Questions

Explain can static variables be declared in a header file?

915


any "C" function by default returns an a) int value b) float value c) char value d) a & b

875


What is void main () in c?

951


What is a global variable in c?

783


What is derived datatype in c?

839


Explain what is wrong in this statement?

851


What is the use of extern in c?

850


Explain how does flowchart help in writing a program?

875


what is a function method?give example?

2130


How to implement a packet in C

2621


Function calling procedures? and their differences? Why should one go for Call by Reference?

846


Write a program to print "hello world" without using a semicolon?

858


What is #include conio h?

791


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

980


How can I automatically locate a programs configuration files in the same directory as the executable?

870