Write a program to find minimum between three no.s whithout
using comparison operator.
Answer Posted / ashutosh tiwari
if((a-b)&0x8000)
if((a-c)&0x8000)
printf("a is smaller");
else if((a-c)&0x7fff)
printf("c is smaller");
else
printf("a & c are equal & smaller");
else if((a-b)&0x7fff)
if((b-c)&0x8000)
printf("b is smaller");
else if((b-c)&0x7fff)
printf("c is smaller");
else
printf("b & c are equal & smaller");
else
if((b-c)&0x8000)
printf("b is smaller");
else if((b-c)&0x7fff)
printf("c is smaller");
else
printf("a, b & c are equal & smaller");
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is a 'null pointer assignment' error?
What is structure in c language?
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
What is time null in c?
How reliable are floating-point comparisons?
how logic is used
Explain how can I convert a number to a string?
Why static is used in c?
What's the best way of making my program efficient?
Do you have any idea how to compare array with pointer in c?
What do you know about the use of bit field?
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?
Why doesnt that code work?
When is the “void” keyword used in a function?
What are different types of operators?