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 / n r sree harsha

#include<stdio.h>
#include<math.h> /* for using abs() function */
main()
{
int a,b,c,small;
printf("\n enter numbers");
scanf("%d%d%d",&a,&b,&c);
if(abs(a-b)-(a-b))
{
if(abs(a-c)-(a-c))
{
s=a;
else
s=c;
}
else
{
if(abs(b-c)-(b-c))
{
s=b;
else
s=c;
}
}
printf("\n small=%d",s);
}

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is structure padding and packing in c?

1124


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

1571


C language questions for civil engineering

1764


Why is C language being considered a middle level language?

1205


What does d mean?

1163


What is mean by data types in c?

1070


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10

15887


What language is c written?

1098


Can main () be called recursively?

1175


Explain modulus operator. What are the restrictions of a modulus operator?

1057


Do you know the use of 'auto' keyword?

1260


What is %lu in c?

1326


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1914


Explain how do you determine the length of a string value that was stored in a variable?

1196


Explain what is a 'locale'?

1126