find a number whether it is even or odd without using any
control structures and relational operators?

Answer Posted / d.c.sathishkumar

#include<stdio.h>
main()
{
int n;
char *p[]={"Even","odd"};
Printf("Enter the number");
scanf("%d",&n);
n=n%2;
printf("The value is %s",a[n]);

}

Is This Answer Correct ?    17 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have function or method?

582


What does sizeof return c?

592


How can I dynamically allocate arrays?

583


What is the use of f in c?

551


What is printf () in c?

574






What is the difference between char array and char pointer?

519


How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include...

4896


Why is extern used in c?

606


Which is better pointer or array?

589


What is a file descriptor in c?

555


What is the method to save data in stack data structure type?

598


How can I read data from data files with particular formats?

594


What is string function in c?

529


Explain how do you list a file’s date and time?

615


How many keywords (reserve words) are in c?

603