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...

How to add two numbers without using arithmetic operators?

Answer Posted / roopali

#include<stdio.h>
int sum(int num1, int num2);
int main()
{
int num1, num2, result;
printf("Enter the number:");
scanf("%d%d",&num1,num2);
result=sum(num1,num2);
printf("The sum of two numbers is:%d",result);
return 0;
}

int sum(int num1, int num2)
{
int i;
for(i=0;i<num2;i++)
{
num1++;
}
return num1;
}

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are structure members?

1090


What is the process to create increment and decrement stamen in c?

1056


What is a pointer and how it is initialized?

1154


Explain about the constants which help in debugging?

1371


What does %2f mean in c?

1212


How can a number be converted to a string?

1322


What is class and object in c?

1115


Is flag a keyword in c?

1148


Why should I use standard library functions instead of writing my own?

1264


What are the types of bitwise operator?

1107


What does *p++ do?

1019


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

1091


Is that possible to add pointers to each other?

1367


What is graph in c?

1054


What kind of structure is a house?

1038