ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       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
Google
   
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther 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?
Answer
# 1
using aadd()function we can add the arguements without
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?
Answer
# 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
 
 
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
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) HCL2
how many error occurs in C language ? Wipro21
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 Accenture2
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 Mascot2
What are the preprocessors? HP6
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<stdio.h> 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 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2012  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com