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 / srinu

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,i,j,k=0;
printf("enter 2 numbers");
scanf("%d%d",&a,&b);
if(a>b)
{
k=b;
for(i=1;i<=a;i++)
k++;
}
else
{
k=a;
for(j=1;j<=b;j++)
k++;
}
printf("sum of 2 numbers is %d",k);
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by inheritance?

1059


What is the modulus operator?

1169


What is typedef example?

1129


typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none

1171


Can you apply link and association interchangeably?

1083


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1165


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1757


What does s c mean on snapchat?

1055


Why do we use static in c?

1082


Explain two-dimensional array.

1025


What are the different categories of functions in c?

1107


Explain the use of function toupper() with and example code?

1088


How can I find the modification date and time of a file?

1051


What is spark map function?

1071


How do you write a program which produces its own source code as output?

1077