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

What is the difference between struct and typedef struct in c?

659


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1425


Can an array be an Ivalue?

667


When is the “void” keyword used in a function?

840


Write a program to use switch statement.

662






Compare and contrast compilers from interpreters.

684


Explain modulus operator. What are the restrictions of a modulus operator?

601


State the difference between realloc and free.

636


How is a pointer variable declared?

595


Can you please explain the difference between syntax vs logical error?

698


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

638


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

2373


Do you know the difference between malloc() and calloc() function?

616


Is Exception handling possible in c language?

1586


Why do some versions of toupper act strangely if given an upper-case letter?

635