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


Please Help Members By Posting Answers For Below Questions

What is the use of static variable in c?

587


What is static memory allocation?

597


This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory

719


What are the 5 elements of structure?

557


Are pointers really faster than arrays?

552






What language is lisp written in?

609


What are the types of type specifiers?

616


How do I read the arrow keys? What about function keys?

606


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

657


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

624


explain what is fifo?

628


What is array of structure in c?

590


What is a class c rental property?

598


What are the types of i/o functions?

671


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜nā€™ element.

1576