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 meant by inheritance?
What is the modulus operator?
What is typedef example?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
Can you apply link and association interchangeably?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What does s c mean on snapchat?
Why do we use static in c?
Explain two-dimensional array.
What are the different categories of functions in c?
Explain the use of function toupper() with and example code?
How can I find the modification date and time of a file?
What is spark map function?
How do you write a program which produces its own source code as output?