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

Why doesn't C support function overloading?

2868


Differentiate between the = symbol and == symbol?

1365


An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above

1225


What does typeof return in c?

1161


What is openmp in c?

1068


Do you have any idea how to compare array with pointer in c?

1094


List some applications of c programming language?

999


5 Write an Algorithm to find the maximum and minimum items in a set of ā€˜n’ element.

2160


Write the control statements in C language

1281


What is meant by 'bit masking'?

1438


What is union in c?

1166


what is uses of .net

1787


What are types of structure?

1171


write a program to print largest number of each row of a 2D array

2372


C language questions for civil engineering

1766