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 does void main return?
What are the types of pointers in c?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
why do some people write if(0 == x) instead of if(x == 0)?
Stimulate calculator using Switch-case-default statement for two numbers
Explain the difference between null pointer and void pointer.
Explain the process of converting a Tree into a Binary Tree.
Disadvantages of C language.
What is sizeof c?
What are the similarities between c and c++?
What does c mean in basketball?
Why is extern used in c?
What is the difference between array and pointer in c?
Write a factorial program using C.
What are valid operations on pointers?