How to add two numbers without using arithmetic operators?

Answer Posted / chirantan

//program to add two numbers without using + operator//
#include<stdio.h>
main()
{
int a,b,c;
printf("\n enter two numbers to add\n");
scanf("%d %d", &a,&b);
c=((a*a)-(b*b))/(a-b);
}

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why & is used in scanf in c?

798


How do you use a pointer to a function?

844


What does. int *x[](); means ?

816


Explain null pointer.

802


What is return in c programming?

704


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

2063


Are pointers integers in c?

792


What is difference between structure and union with example?

801


Ow can I insert or delete a line (or record) in the middle of a file?

768


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

834


What functions are in conio h?

876


Explain what is wrong with this statement? Myname = ?robin?;

1314


What is %d called in c?

930


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

942


What is action and transformation in spark?

817