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
What is the difference between test design and test case design?
What are header files in c programming?
What is 'bus error'?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
How do you do dynamic memory allocation in C applications?
How can I manipulate strings of multibyte characters?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
Explain modulus operator.
Why clrscr is used after variable declaration?
What are lookup tables in c?
What is conio h in c?
What is volatile keyword in c?
Why pointers are used?
Write a C program in Fibonacci series.
What is const and volatile in c?