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

How can variables be characterized?

2184


How can you invoke another program from within a C program?

1073


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1243


Where in memory are my variables stored?

1177


In a byte, what is the maximum decimal number that you can accommodate?

1136


hi any body pls give me company name interview conduct "c" language only

2280


How can you access memory located at a certain address?

1114


What are the 32 keywords in c?

1090


What is a pointer on a pointer in c programming language?

1139


What is "Duff's Device"?

1165


Do you have any idea about the use of "auto" keyword?

1079


Do you know pointer in c?

1044


Why doesnt that code work?

1171


Is array name a pointer?

1028


What are the different types of C instructions?

1309