Question:
How to add 2 numbers without + sign?
Answer:
Ans is :: ((a*a)-(b*b))/(a-b)
make a try it will work Source: CoolInterview.com
Answered by: Simrat pal Singh | Date: 5/20/2008
| Contact Simrat pal Singh
You could probably just do a-(0-b). Source: CoolInterview.com
Answered by: Amit C | Date: 6/15/2008
| Contact Amit C
a+b=a-(-b) simple one .isn't it Source: CoolInterview.com
Answered by: om prakash mishra | Date: 6/16/2008
| Contact om prakash mishra
a+b=a&b Source: CoolInterview.com
Answered by: charan | Date: 6/22/2008
| Contact charan
void main( void ) { int a = 15; int b = 16; int c = ((a*a) - (b*b))/(a-b); printf("%d ",c); } Source: CoolInterview.com
Answered by: Arun | Date: 7/2/2008
| Contact Arun
ans:
int a,b,c; c=a||b; printf("%c",c); Source: CoolInterview.com
Answered by: elumalai ms | Date: 7/10/2008
| Contact elumalai ms
"((a*a)-(b*b))/(a-b)" The above one will not work. it is broken for a = 1 and b = 1. the result is 0/0. Source: CoolInterview.com
Answered by: Krishna Reddy | Date: 8/7/2008
| Contact Krishna Reddy
#include <stdio.h> int add(int a, int b){ if (!a) return b; else return add((a & b) << 1, a ^ b); }
int main(){ int a,b; printf("Enter the two numbers: ");
scanf("%d",&a); scanf("%d",&b); printf("Sum is: %d",add(a,b)); } /*pls use bitwise operators */ Source: CoolInterview.com
Answered by: sharad kumar .j | Date: 12/16/2008
| Contact sharad kumar .j
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|