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

What is the difference between delete and delete[]

1639


What is the purpose of static methods and static variables?

1124


What is string data type?

1015


Can we have a method name same as class name in java?

1096


What do you mean by constant time complexity?

1331


What is the primary benefit of encapsulation?

1151


What are implicit objects in java?

1020


Which is fastest collection in java?

1144


Can we use static class instead of singleton?

1094


What do heavy weight components mean in java programming?

996


Which list is sorted in java?

1083


What is the java virtual machine?

1138


A person says that he compiled a java class successfully without even having a main method in it? Is it possible?

1107


Give some features of interface?

1132


What is the flag in java?

1106