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
Can we declare variables anywhere in c?
What is merge sort in c?
What are pointers? What are different types of pointers?
What is extern variable in c with example?
What is the best way to comment out a section of code that contains comments?
Explain what are compound statements?
write a program to concatenation the string using switch case?
How can I manipulate individual bits?
How the c program is executed?
how can use subset in c program and give more example
Are the expressions * ptr ++ and ++ * ptr same?
Write a program to use switch statement.
I need previous papers of CSC.......plz help out by posting them.......
What is the difference between void main and main in c?
Can a variable be both constant and volatile?