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

Can we cast any other type to boolean type with type casting?

961


What is proper subset?

978


What is string in java?

1018


Write a method that will remove given character from the string?

1031


How to avoid memory leak in java?

1141


What do you know about java?

945


What is constructor and its types?

1150


What is tcp ip in java?

1119


State the difference between strings and arrays.

1248


Is java ee a framework?

992


What is difference between static and final?

1072


How can we find the sum of two linked lists using stack in java?

1157


Why is stringbuffer thread safe?

1051


What is the purpose of using the java bean?

1054


How to make object serializable in java?

993