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

What are linked lists in c?

1177


What are the string functions? List some string functions available in c.

1037


What is class and object in c?

1172


what are bit fields? What is the use of bit fields in a structure declaration?

2198


What are the 5 organizational structures?

1080


The file stdio.h, what does it contain?

1212


What are loops in c?

1064


What should malloc() do? Return a null pointer or a pointer to 0 bytes?

1134


Explain how can you restore a redirected standard stream?

1152


What is difference between main and void main?

1285


How can I discover how many arguments a function was actually called with?

1112


How can you be sure that a program follows the ANSI C standard?

1655


How do I get an accurate error status return from system on ms-dos?

1175


How do I use strcmp?

1128


How do I round numbers?

1051