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
How many levels of pointers can you have?
Write the Program to reverse a string using pointers.
find out largest elemant of diagonalmatrix
Why can arithmetic operations not be performed on void pointers?
What is the use of the function in c?
What is union and structure in c?
Explain Basic concepts of C language?
What are the advantages of c preprocessor?
Where are the auto variables stored?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
How can I remove the trailing spaces from a string?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Who invented bcpl language?
Tell me when would you use a pointer to a function?
What is #include in c?