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

How do I copy files?

1000


What is static memory allocation?

1099


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

2400


What are the three constants used in c?

930


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

2186


What is the use of a conditional inclusion statement in C?

1009


provide an example of the Group by clause, when would you use this clause

2128


Which header file is essential for using strcmp function?

1423


Are local variables initialized to zero by default in c?

984


can we have joblib in a proc ?

2231


Is c language still used?

933


What is scanf_s in c?

1067


why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above

1070


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1585


Explain the difference between #include "..." And #include <...> In c?

982