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 doesn't C support function overloading?
difference between Low, Middle, High Level languages in c ?
What is the newline escape sequence?
How can I sort a linked list?
Is a house a mass structure?
What is #include cctype?
What does the format %10.2 mean when included in a printf statement?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is string constants?
How can I recover the file name given an open stream or file descriptor?
Why can arithmetic operations not be performed on void pointers?
Explain a file operation in C with an example.
Why do we use & in c?
Why do we use pointer to pointer in c?
Explain how do you generate random numbers in c?