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 the data types present in c?
a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above
Why & is used in scanf in c?
Write a program to reverse a string.
Are negative numbers true in c?
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What are header files and what are its uses in C programming?
Is c# a good language?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Tell me can the size of an array be declared at runtime?
Explain the advantages of using macro in c language?
Can you tell me how to check whether a linked list is circular?
Can we declare variables anywhere in c?
What is identifiers in c with examples?
Difference between pass by reference and pass by value?