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 program to compare 2 numbers without using logical
operators?

Answer Posted / jj

unsigned int is_same(unsigned int a, unsigned int b)
{
return (a / b);
}

int main()
{
unsigned int a, b;
a = 40, b = 40;

if ( is_same(a,b) == 1 )?
cout << "Equal" << endl
:
cout << "Not equal" << endl;
return 0;
}

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why & is used in scanf in c?

1055


Do you have any idea how to compare array with pointer in c?

1007


What is the difference between NULL and NUL?

1255


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1674


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1968


What is the use of parallelize in spark?

991


Can you return null in c?

1110


What is typedf?

1081


Describe the modifier in c?

1065


Explain what are binary trees?

1039


What are the rules for the identifier?

1121


Explain modulus operator.

1010


What is the use of typedef in c?

1003


How are variables declared in c?

1049


What is pass by value in c?

1025