Write a program to find minimum between three no.s whithout
using comparison operator.

Answer Posted / ashutosh tiwari

if((a-b)&0x8000)
if((a-c)&0x8000)
printf("a is smaller");
else if((a-c)&0x7fff)
printf("c is smaller");
else
printf("a & c are equal & smaller");
else if((a-b)&0x7fff)
if((b-c)&0x8000)
printf("b is smaller");
else if((b-c)&0x7fff)
printf("c is smaller");
else
printf("b & c are equal & smaller");
else
if((b-c)&0x8000)
printf("b is smaller");
else if((b-c)&0x7fff)
printf("c is smaller");
else
printf("a, b & c are equal & smaller");

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program of prime number using recursion.

622


Write a program to check palindrome number in c programming?

601


difference between Low, Middle, High Level languages in c ?

1635


What is the sizeof () a pointer?

550


I need previous papers of CSC.......plz help out by posting them.......

1818






What is operator precedence?

645


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1860


How can I invoke another program or command and trap its output?

619


What is a lookup table in c?

628


Where in memory are my variables stored?

638


Explain how do you declare an array that will hold more than 64kb of data?

905


What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

626


What is a scope resolution operator in c?

752


What is union and structure in c?

619


What is the difference between void main and main in c?

626