Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is a 'null pointer assignment' error?

1247


What is structure in c language?

1235


5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.

2158


What is time null in c?

1105


How reliable are floating-point comparisons?

1137


how logic is used

2021


Explain how can I convert a number to a string?

1203


Why static is used in c?

1143


What's the best way of making my program efficient?

1146


Do you have any idea how to compare array with pointer in c?

1090


What do you know about the use of bit field?

1096


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1133


Why doesnt that code work?

1268


When is the “void” keyword used in a function?

1564


What are different types of operators?

1091