write a c program to add two integer numbers without using
arithmetic operator +

Answer Posted / praveenkumar

main()
{
int a,b,c;
printf("enter a,b values:");
scanf("%d%d",&a,&b);
c=((a)-(-b));
printf("a+b="&c);
}

Is This Answer Correct ?    66 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create struct variables?

829


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

1048


What is local and global variable in c?

869


How is null defined in c?

884


I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

780


What is the use of #include in c?

822


Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)

2107


Tell me the use of bit field in c language?

856


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

873


What are enumerated types?

862


How is = symbol different from == symbol in c programming?

830


What is the significance of c program algorithms?

898


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2961


Lists the benefits of c programming language?

836


What is the correct declaration of main?

922