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 the data types present in c?

1160


a c variable cannot start with a) an alphabet b) a number c) a special symbol d) both b and c above

1223


Why & is used in scanf in c?

1098


Write a program to reverse a string.

1072


Are negative numbers true in c?

1060


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1857


What are header files and what are its uses in C programming?

1228


Is c# a good language?

1009


Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......

2187


Tell me can the size of an array be declared at runtime?

1037


Explain the advantages of using macro in c language?

994


Can you tell me how to check whether a linked list is circular?

1406


Can we declare variables anywhere in c?

999


What is identifiers in c with examples?

1175


Difference between pass by reference and pass by value?

1156