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...

without using arthematic operation ,how can you write the
logic for adding/substraction/multiplication?

Answer Posted / sankar

Without using arthematic operation adding two numbers:

#include<stdio.h>
int main()
{
int a=5,b=6;
while(b)
{
a=a^b;
b=(a^b)&b;
b=b<<1;
}
printf("The sum of a and b is: %d\n",a);
return 0;
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you define a variable?

897


Is alive in java?

903


Can we call the constructor of a class more than once for an object?

1046


What do you understand by classes in java?

956


Why parsing is done?

922


2) Suppose there are 5 directories having lot of files (say txt files) in each directory. 2 things :- 2.1) You want to search for filenames which have a particular pattern. 2.2) Out of these filtered files you want to search for a particular keyword or a search string. How can you achieve this?

2246


How do you use compareto?

895


What is a method declaration?

946


How do you input a string in java?

1006


What are the 3 types of control structures?

966


Can we restart a thread already started in java?

1055


How do you start a thread?

986


How to sort an unsorted array in java?

1083


When we should use serialization?

975


Tell me about different OOPS concepts.

960