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

Can we declare variables anywhere in c?

1002


What is merge sort in c?

1051


What are pointers? What are different types of pointers?

1149


What is extern variable in c with example?

997


What is the best way to comment out a section of code that contains comments?

1346


Explain what are compound statements?

1063


write a program to concatenation the string using switch case?

2108


How can I manipulate individual bits?

1043


How the c program is executed?

1160


how can use subset in c program and give more example

1996


Are the expressions * ptr ++ and ++ * ptr same?

1156


Write a program to use switch statement.

1134


I need previous papers of CSC.......plz help out by posting them.......

2298


What is the difference between void main and main in c?

1156


Can a variable be both constant and volatile?

1126