Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
 Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE

 Categories  >>  Software  >>  Programming Languages  >>  C

 C Interview Questions C++ Interview Questions VC++ Interview Questions Delphi Interview Questions Programming Languages AllOther Interview Questions
Question
```sir i wanted to know how we wap in c to add numbers without
using arithmetic operator in which digits  are entered by
user?

```
Question Submitted By :: Rohit Sharma
I also faced this Question!!     Rank Answer Posted By

Re: sir i wanted to know how we wap in c to add numbers without using arithmetic operator in which digits are entered by user?
# 1
using arithmetic operator

 Is This Answer Correct ? 1 Yes 2 No
Sheshivardhan Reddy.rayala

Re: sir i wanted to know how we wap in c to add numbers without using arithmetic operator in which digits are entered by user?
# 2
#include<stdio.h>

int main()
{
int a,b,sum,carry;
printf("\n Enter the numbers : ");
scanf("%d%d",&a,&b);
sum=a^b;
carry=a&b; // Produce a extra carry bit if present
while(carry!=0)
{
carry<<=1; // shift for every iteration so
that it gets added with the next digit
a=sum;
b=carry;
sum=a^b; // perform Xor Operation
carry=a&b; // Calculate the new value for carry
}
printf("\n The sum is %d", sum);
}

 Is This Answer Correct ? 3 Yes 1 No
Niranjan Vg

  Question Asked @ Answers Other C Interview Questions 4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none 10 read an array and search an element 1 What are .h files and what should I put in them? 3 What is the mean of this statement:: if(int i=0 * i=9) HCL 2 how many error occurs in C language ? Wipro 21 A function 'q' that accepts a pointer to a character as argument and returns a pointer to an array of integer can be declared as: A)int (*q(char*)) [] B)int *q(char*) [] C)int(*q)(char*) [] D)None of the Above Accenture 2 what is link list? 3 Struct(s) { int a; long b; } Union (u) {int a; long b; } Print sizeof(s)and sizeof(u) if sizeof(int)=4 and sizeof(long)=4 Mascot 2 What are the preprocessors? HP 6 c programming of binary addition of two binary numbers 3 main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); } 4 what is the output of the following program? #include void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } } 4 For more C Interview Questions Click Here