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 C program to find the smallest of three integers,
without using any of the comparision operators.

Answer Posted / niranjan

main()
{
int a=5,b=2,c=3; /*Assuming a Use Case */
int d; /* d is required a temporary variable */
if(!(a/b)&& !(a/c))
{
d = a; /* Which means a is small */
}
else if ( !(b/a)&&!(b/c))
{
d = b; /* Which means b is small */
}
else
{
d = c;
}

printf("%d",d);
}

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is c system32 taskhostw exe?

1027


Explain low-order bytes.

1038


Where register variables are stored in c?

970


How does selection sort work in c?

1041


What is extern storage class in c?

998


What are enumerated types?

1194


How can I find out if there are characters available for reading?

1111


What are the two types of functions in c?

1013


Why is c so popular?

1163


Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?

3519


Can the sizeof operator be used to tell the size of an array passed to a function?

1118


What is meant by operator precedence?

1149


What is difference between structure and union with example?

1059


code for quick sort?

2033


What are the benefits of organizational structure?

1029