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
Why doesn't C support function overloading?
Differentiate between the = symbol and == symbol?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What does typeof return in c?
What is openmp in c?
Do you have any idea how to compare array with pointer in c?
List some applications of c programming language?
5 Write an Algorithm to find the maximum and minimum items in a set of ānā element.
Write the control statements in C language
What is meant by 'bit masking'?
What is union in c?
what is uses of .net
What are types of structure?
write a program to print largest number of each row of a 2D array
C language questions for civil engineering