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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Answer / mohith

a=0x08;
d=0x02;
e=a|d;

Is This Answer Correct ?    2 Yes 8 No

Post New Answer

More C Interview Questions

What is bss in c?

0 Answers  


Program to write some contents into a file using file operations with proper error messages.

2 Answers  


What are enumerated types?

0 Answers  


write a c program that if the given number is prime, and their rearrangement(permute) of that number is also prime. Ex: Input is "197" is prime Output: 791,917,179 is also prime. Please any one tell me tha code for that

3 Answers  


main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }

1 Answers   Vector,






main() { float a=8.8; double b=8.8; if(a==b) printf("Equal"); else printf("not equal"); getch(); } what is the output? with reason

6 Answers   CSC,


main() { float a=3.2e40; printf("%d",a); }

9 Answers   Satyam,


What is Memory leakage ?

2 Answers   HCL,


List some basic data types in c?

0 Answers  


Which header file is essential for using strcmp function?

0 Answers  


Which is more efficient, a switch statement or an if else chain?

0 Answers  


#include<stdio.h> #include<conio.h> void main() { int m=0111,n=20; printf("%d%d\n",m,n); getch(); }

1 Answers  


Categories