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 / srinivas

#include <stdio.h>

int main(void)
{
int a = 10, b = 2, c = 30, result;

result = a < b ? ((a < c) ? a: c) : ((b < c) ? b : c);
printf("%d\n",result);
return 0;


}

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why main is used in c?

1070


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

1091


How can I swap two values without using a temporary?

1101


Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

1084


What is the argument of a function in c?

1045


What is the best way of making my program efficient?

1029


explain what are actual arguments?

1086


Is c a great language, or what?

1109


Explain how do you print an address?

1144


What is the difference between memcpy and memmove?

1016


What is I ++ in c programming?

1112


What is the difference between NULL and NUL?

1290


How can I sort a linked list?

1045


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

1063


Can we declare a function inside a function in c?

1033