How to add two numbers without using arithmetic operators?

Answers were Sorted based on User's Feedback



How to add two numbers without using arithmetic operators?..

Answer / ramanareddy

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("enter the two numbers");
scanf("%d %d",%a,&b);
c=(-(-a-b));
printf("sum is = %d",c");
getch();
}

Is This Answer Correct ?    0 Yes 4 No

How to add two numbers without using arithmetic operators?..

Answer / abhishek shukla

what will be output of this programme?
#include<stdio.h>
#include<conio.h>
void main()
{
int a=5;
clrscr();
a=a+(2,3,3,5,8,6);
printf("%d",a);
getch();
}

Is This Answer Correct ?    1 Yes 6 No

How to add two numbers without using arithmetic operators?..

Answer / nitish

why cant we just or the two numbers

Is This Answer Correct ?    9 Yes 20 No

How to add two numbers without using arithmetic operators?..

Answer / pugalarasu

int sum(int num1,int num2)
{
for(int i=0;i<num2;i++)
num1++;
return num1;
}

Is This Answer Correct ?    39 Yes 50 No

How to add two numbers without using arithmetic operators?..

Answer / ranjith

#include<stdio.h>
main()
{
int a=5,b=4,c;
c=a||b;
printf("sum="+c);
}

Is This Answer Correct ?    2 Yes 21 No

How to add two numbers without using arithmetic operators?..

Answer / suhas

# include <stdio.h>
main()
{
int a=8,b=2;
a|=b;
printf("sum="+a);
}

Is This Answer Correct ?    7 Yes 43 No

How to add two numbers without using arithmetic operators?..

Answer / kavi

#include<stdio.h>
int a,b,c;
{
printf("enter the two values");
scanf("%d","%d",&a,&b);
c=a||b;
}

Is This Answer Correct ?    10 Yes 80 No

How to add two numbers without using arithmetic operators?..

Answer / prashant

even this gives the same ans as the above program gives...
just every one plz check it and tell me
#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c;
printf("enter the nos");
scanf("%d %d",&b,&c);
a= (b^c);
printf("%d",a);
return 0;
}

Is This Answer Correct ?    19 Yes 114 No

Post New Answer

More C Interview Questions

What is file in c preprocessor?

0 Answers  


What is table lookup in c?

0 Answers  


write a progam to display the factors of a given number and disply how many prime numbers are there?

2 Answers  


WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR LOOPS. A) * B) ***** *** * * ***** * * *****

2 Answers  


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

0 Answers  






What is the heap?

0 Answers  


simple program of graphics and thier outpu display with a want what is out put of graohics in c language

1 Answers   CSC, HCL,


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

0 Answers  


What does volatile do?

0 Answers  


void main() { for(; 0 ;) ... { printf("hello"); ... } getch(); }

1 Answers  


Explain how do you list files in a directory?

0 Answers  


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a<b,printb.find the sum digits of that number & then print.if a==b multiply 10 with a & add 20 with b store in c and then print

0 Answers  


Categories