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

Can you please explain the difference between strcpy() and memcpy() function?

1014


What is bubble sort technique in c?

931


What are reserved words with a programming language?

1054


what do u mean by Direct access files? then can u explain about Direct Access Files?

2029


Tell us bitwise shift operators?

1021


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

1084


What is the difference between test design and test case design?

2028


Can true be a variable name in c?

985


Write a program to show the change in position of a cursor using c

995


Write a program to generate the Fibinocci Series

1157


Is main an identifier in c?

1085


A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile

1048


how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software

3258


Can one function call another?

1048


What does calloc stand for?

1083