write a c program to add two integer numbers without using
arithmetic operator +
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / vijayram600
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=20;
clrscr();
while(b--) a++;
printf("Sum is :%d",a);
getch();
}
Is This Answer Correct ? | 21 Yes | 7 No |
Answer / venky
main()
{
int a,b,c;
printf("enter a,b values:");
scanf("%d%d",&a,&b);
c=((a)-(-b));
printf("sum of a,b is %d",c);
}
Is This Answer Correct ? | 11 Yes | 3 No |
Answer / sushma sarma
#include<iostream.h>
int main()
{
int a,b;
cout<<"Enter a and b";
cin>>a;
cin>>b;
while(a!=0)
{
++b;
a--;
}
cout<<b;
return 0;
}
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / maksim
a = 53;
int c = 0b10000000;
int d = c;
printf("c=%d\n",c);
s = 30;
while(c>0){
int d = c;
if (a&d){
while ((s&d)&&(d<=128)) {
s = (s&~d);
d = d<<1;
}
d = (d<=128)?d:0;
s = s|d;
}
c = c>>1;
}
printf("s=%d\n",s);
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / raja
void main()
{
int a=20,b=40;
for( ;b<=1;b--)
a++;
printf("%d",a);
}
Is This Answer Correct ? | 6 Yes | 4 No |
Answer / sivaprabhu
main()
{
int a,b,c;
printf("enter the values a,b");
scanf("%d%d",&a,&b);
c=a-(~b)-1;
printf("the sum is %d",c);
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / nandu
#include<stdio.h>
#include<conio.h.
void main()
{
int a=10,b=20,c;
c=a-(-b);
printf("%d\n",c);
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / syamanth
main()
{
int a,b,c;
printf("enter a,b values:");
scanf("%d%d",&a,&b);
c=((a)-(~b)+1);
printf("sum of a,b is %d",c);
}
Is This Answer Correct ? | 0 Yes | 0 No |
c program for searching a student details among 10 student details
what is the advantage of function pointer
16 Answers CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,
Explain output of printf("Hello World"-'A'+'B'); ?
main() { int i=400,j=300; printf("%d..%d"); }
hOW Can I add character in to pointer array of characters char *a="indian"; ie I want to add google after indian in the char *a
how to TOGGLE Nth bit of variable in a MACRO
what is diognisis?
Where static variables are stored in memory in c?
how to introdu5ce my self in serco
What is sizeof array?
#include<stdio.h> int fun(); int i; int main() { while(i) { fun(); main(); } printf("hello \n"); return 0; } int fun() { printf("hi"); } answer is hello.how??wat is tat while(i) mean?
Define Array of pointers.