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 doesn't C support function overloading?

2609


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

2024


What is the newline escape sequence?

1020


How can I sort a linked list?

973


Is a house a mass structure?

1052


What is #include cctype?

1076


What does the format %10.2 mean when included in a printf statement?

1587


a value that does not change during program execution a) variabe b) argument c) parameter d) none

1181


What is string constants?

1097


How can I recover the file name given an open stream or file descriptor?

1030


Why can arithmetic operations not be performed on void pointers?

982


Explain a file operation in C with an example.

1054


Why do we use & in c?

950


Why do we use pointer to pointer in c?

1021


Explain how do you generate random numbers in c?

1043