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
Is main is a keyword in c?
What are predefined functions in c?
how do you execute a c program in unix.
What is pointer & why it is used?
What do you mean by invalid pointer arithmetic?
Who is the founder of c language?
What is character set?
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...
What is FIFO?
Which is the best website to learn c programming?
What is the use of pragma in embedded c?
Array is an lvalue or not?
When is a null pointer used?
What is main () in c?
What does %d do?