write a program to compare 2 numbers without using logical
operators?
Answer Posted / jj
unsigned int is_same(unsigned int a, unsigned int b)
{
return (a / b);
}
int main()
{
unsigned int a, b;
a = 40, b = 40;
if ( is_same(a,b) == 1 )?
cout << "Equal" << endl
:
cout << "Not equal" << endl;
return 0;
}
| Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
Why & is used in scanf in c?
Do you have any idea how to compare array with pointer in c?
What is the difference between NULL and NUL?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is the use of parallelize in spark?
Can you return null in c?
What is typedf?
Describe the modifier in c?
Explain what are binary trees?
What are the rules for the identifier?
Explain modulus operator.
What is the use of typedef in c?
How are variables declared in c?
What is pass by value in c?