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


September 09, 2008 15:45:00 #8
 rashmi.mohanty J2EE Expert  Member Since: September 2008    Total Comments: 8 

RE: sum of two numbers without using arithmetic operators
 
void main(){
    int a=5,b=7,i;
    for(i=1;i<=a;i++)
         b++;
    printf("sum value:%d",b);
}
     

 

Back To Question