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                      
Google
   
 
Categories >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2262)
 C++ interview questions  C++ Interview Questions (1118)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (646)
Question
write a c program to add two integer numbers without using 
arithmetic operator +
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
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 ?    60 Yes 3 No
Praveenkumar
 
Answer
# 2
#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 ?    19 Yes 7 No
Vijayram600
 
 
 
Answer
# 3
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 ?    9 Yes 3 No
Venky
 
Answer
# 4
#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
Sushma Sarma
 
Answer
# 5
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
Maksim
 
Answer
# 6
void main()
{
int a=20,b=40;
for( ;b<=1;b--)
a++;
printf("%d",a);
}
 
Is This Answer Correct ?    6 Yes 4 No
Raja
 
Answer
# 7
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
Sivaprabhu
 
Answer
# 8
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
Syamanth
 
Answer
# 9
#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 ?    0 Yes 0 No
Nandu
 
Answer
# 10
a=0x08;
d=0x02;
e=a|d;
 
Is This Answer Correct ?    2 Yes 7 No
Mohith
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+.... Ignou 2
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting. TCS 1
main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); } CitiGroup 24
write a c program to check weather a particluar bit is set or not? IBM 5
What are data breakpoints? Adobe 3
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output? Hughes 7
Write a routine that prints out a 2-D array in spiral order! Lucent 1
any string of bits of length 'n' represents a unique non- negative integer between.............?   2
1.Why do you call C is middle level language? 2.Why do you call C is userfriendly language.   2
void main() { int i=5; printf("%d",i++ + ++i); } ME 21
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database TCS 2
Which of the following data structures is on average the fastest for retrieving data: 1) Binary Tree 2) Hash Table 3) Stack   3
 
For more C Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com