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
What is line in c preprocessor?
What is action and transformation in spark?
Is it possible to execute code even after the program exits the main() function?
write a program to generate address labels using structures?
What does *p++ do?
Is javascript based on c?
Differentiate between static and dynamic modeling.
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is the difference between array_name and &array_name?
What is the ANSI C Standard?
Is c a great language, or what?
What does %c do in c?
Explain what is meant by 'bit masking'?