write a c program to find biggest of 3 number without
relational operator?
Answer Posted / abhishek
There is small mistake in "Kishore Kumar Naik" answer.
int main()
{
int nNum1, nNum2, nNum3;
int nRes,nSize, nBig;
nSize = sizeof(int) * 8;
printf("\nEnter 3 numbers");
scanf("%d%d%d", &nNum1, &nNum2, &nNum3);
nRes = nNum1 - nNum2;
nRes = nRes >> nSize -1;
nBig = nRes ? nNum2 : nNum1;
nRes = nBig - nNum3;
nRes = nRes >> nSize -1;
nBig = nRes ? nNum3 : nBig;
printf("big num = %d", nBig);
}
| Is This Answer Correct ? | 17 Yes | 16 No |
Post New Answer View All Answers
Why is c still so popular?
What is a memory leak? How to avoid it?
What is break in c?
I have seen function declarations that look like this
Can a file other than a .h file be included with #include?
Differentiate between Macro and ordinary definition.
What is the size of a union variable?
Why is c so important?
What is c token?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
How can a process change an environment variable in its caller?
What is a pointer value and address in c?
How do c compilers work?
List some basic data types in c?
Why is not a pointer null after calling free?