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


July 07, 2008 06:41:48 #1
 jintojos   Member Since: May 2008    Total Comments: 29 

RE: sum of two numbers without using arithmetic operators
 
void main()
 {
          int a=10,b=20;
          while(b--) a++;
           printf("Sum is :%d",a);  
 }
     

 

Back To Question