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
What is the difference between struct and typedef struct in c?
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
Can an array be an Ivalue?
When is the “void” keyword used in a function?
Write a program to use switch statement.
Compare and contrast compilers from interpreters.
Explain modulus operator. What are the restrictions of a modulus operator?
State the difference between realloc and free.
How is a pointer variable declared?
Can you please explain the difference between syntax vs logical error?
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
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
Do you know the difference between malloc() and calloc() function?
Is Exception handling possible in c language?
Why do some versions of toupper act strangely if given an upper-case letter?