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

Is null valid for pointers to functions?

600


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


Can we access the array using a pointer in c language?

554


What is a pointer variable in c language?

637


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

822






How can you draw circles in C?

613


what is recursion in C

601


Explain how can I open a file so that other programs can update it at the same time?

581


How can I copy just a portion of a string?

808


Explain the use of #pragma exit?

686


Explain what is the benefit of using an enum rather than a #define constant?

708


What is external variable in c?

605


What is the difference between void main and main in c?

613


Explain what is the difference between text files and binary files?

606


What is merge sort in c?

634