GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Programming  >  C

 Print  |  
Question:  Sum of two numbers without using arithmetic operators

Answer: ex:
int a=10;
int b=10;
int sum=a+b;
without using "+" operator calculate sum


August 08, 2008 01:50:32 #6
 sriranga.ch   Member Since: August 2008    Total Comments: 3 

RE: sum of two numbers without using arithmetic operators
 
void main()
{
int a=10,b=10;
a=a<<1;
b=b<<1;
printf("Sum of a&b is %dn",(a&b));
}
     

 

Back To Question