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 biggest of 3 number without
relational operator?

Answer Posted / abhishek

There is small mistake in "Kishore Kumar Naik" answer.

int main()
{
int nNum1, nNum2, nNum3;
int nRes,nSize, nBig;
nSize = sizeof(int) * 8;
printf("\nEnter 3 numbers");
scanf("%d%d%d", &nNum1, &nNum2, &nNum3);

nRes = nNum1 - nNum2;
nRes = nRes >> nSize -1;

nBig = nRes ? nNum2 : nNum1;

nRes = nBig - nNum3;
nRes = nRes >> nSize -1;

nBig = nRes ? nNum3 : nBig;

printf("big num = %d", nBig);
}

Is This Answer Correct ?    17 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is main is a keyword in c?

1075


What are predefined functions in c?

1025


how do you execute a c program in unix.

1078


What is pointer & why it is used?

1063


What do you mean by invalid pointer arithmetic?

1006


Who is the founder of c language?

1111


What is character set?

1121


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1883


What is FIFO?

1547


Which is the best website to learn c programming?

1036


What is the use of pragma in embedded c?

1006


Array is an lvalue or not?

1069


When is a null pointer used?

1066


What is main () in c?

1015


What does %d do?

1207