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

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

2059


What are header files in c programming?

1101


What is 'bus error'?

1117


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

3499


How do you do dynamic memory allocation in C applications?

1067


How can I manipulate strings of multibyte characters?

1094


Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent

2099


Explain modulus operator.

1022


Why clrscr is used after variable declaration?

1649


What are lookup tables in c?

978


What is conio h in c?

1019


What is volatile keyword in c?

1019


Why pointers are used?

1039


Write a C program in Fibonacci series.

1063


What is const and volatile in c?

1007