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
What are linked lists in c?
What are the string functions? List some string functions available in c.
What is class and object in c?
what are bit fields? What is the use of bit fields in a structure declaration?
What are the 5 organizational structures?
The file stdio.h, what does it contain?
What are loops in c?
What should malloc() do? Return a null pointer or a pointer to 0 bytes?
Explain how can you restore a redirected standard stream?
What is difference between main and void main?
How can I discover how many arguments a function was actually called with?
How can you be sure that a program follows the ANSI C standard?
How do I get an accurate error status return from system on ms-dos?
How do I use strcmp?
How do I round numbers?