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 (2253)
 C++ interview questions  C++ Interview Questions (1111)
 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 ?    57 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 6 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 2 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
 
What is the meaning of int *x[]();?   1
what is the little endian and big endian?   1
Convert the following expression to postfix and prefix X $ Y Z - M + N + P / Q / (R + S)   2
Write a C program to get the desired output. 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 . . . 1 n..............n 1 Note: n is a positive integer entered by the user.   3
#ifdef TRUE int I=0; #endif main() { int j=0; printf("%d %d\n",i,j); } ADITI 3
how i m write c program 1.check prime number 2.prime number series   1
disadvantages of realloc ? HCL 1
Write a C program to find the smallest of three integers, without using any of the comparision operators. TCS 6
#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } } ME 6
Write a program or provide a pseudo code to flip the 2nd bit of the 32 bit number ! (Phone Screen) NetApp 1
write a c program to store and print name,address,roll.no of a student using structures?   6
what is the code for getting the output as * ** *** Caritor 5
 
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