How to add two numbers without using arithmetic operators?

Answer Posted / pakalapati vijaya rama raju

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c=1;
clrscr();
printf("enter the two numbers");
scanf("%d%d",&a,&b);
while(c<=b)
{
a++;
c++;
}
printf("%d",a);
getch();
}

Is This Answer Correct ?    16 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above

665


Suggesting that there can be 62 seconds in a minute?

592


how do you programme Carrier Sense Multiple Access

1510


When is the “void” keyword used in a function?

826


What is the meaning of c in c language?

590






A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1244


Why is c so powerful?

674


What is the mean of function?

642


Is calloc better than malloc?

566


Explain modulus operator. What are the restrictions of a modulus operator?

595


What is header file in c?

597


Is it better to use malloc() or calloc()?

643


how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions

2715


What are extern variables in c?

539


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7385